Branch you silly git
Recently I had a Hard drive failure. This meant a few things, firstly my Monday morning was less than fun. Secondly, I had a chance to test if TimeMachine worked. Time Machine did work, but for some reason the latest complete backup was five days before the failure. A few days lost work, nothing to serious. It has however highlighted
some deficiencies in routine, which has been:
- pull any updates from the server and build if needed,
- noodle with code, committing every so often,
- once finish, possibly several days later, push changes to the server.
Enter the branch
I've been using branches to experiment with idea and share them with folks, but not day to day work. Which in retrospect was a mistake. My daily routine will now be :
- pull any updates from the master branch and merge them with my current branch, build if needed,
- noodle with code, commiting every so often,
- at the very least at the end of the day push my branch to the server, compiling or not,
- once story is finished, merge changes back into master.
Set up
$git checkout -b jaf_wip master
Switched to a new branch 'jaf_wip'
$git push origin jaf_wip
Total 0 (delta 0), reused 0 (delta 0)
To git@git.spiralarm.com:taykt.git
* [new branch] jaf_wip -> jaf_wip
The above creates a new branch and pushes it to the server, this assumes you've already set a server to push to.