Slide 63
Slide 63 text
WILL CRITCHLOW - @willcritchlow
General stuff
1. Set yourself up with upstream = DistilledLtd, origin = your branch and
any other colleagues’ remotes as you need them
2. Regularly pull upstream master into your local master branch
Developing something
1. git checkout master
2. git pull upstream master
3. git checkout -b featurebranch
4. [do your doing]
5. commit regularly, but as close to one commit per ticket as you can
(you can rebase commits for extra special bonus points) add “re
#ticketnum” into your commit message
6. git push origin featurebranch [do this regularly - it’s your best backup]
When you’re ready for something to be tested / deployed:
1. Go to github.com/username/projectname//tree/featurebranch and
create a pull request to upstream master
2. Add the URL of the pull request to the ticket, mark it to test and assign
to the tester
The Distilled git(hub) process
(advanced)
To test a featurebranch:
1. git checkout master
2. git pull upstream master
3. git checkout -b testing
4. git pull personfork featurebranch
1. if there are merge issues, fix ‘em (outside the scope of this
checklist) and instead of pushing the big green button
below, you’d have to push into upstream master
5. do your testing
1. if rejecting, update ticket as appropriate, git checkout
master, git branch -d testing and start again with the next
feature
2. if accepting, merge changes on github pull request using
the big green button, git checkout master, git pull upstream
master git branch -d testing and continue, update ticket to
deploy and assign to the deployer
Rebase (squash commits)
1. You can squash multiple commits into a single commit. This only
works if the commits haven’t been pushed to a remote repository.
git log (to see how many commits you need to squash)
2. git rebase -i HEAD~4 (where 4 is the number of commits you want to
squash)
3. In the editor, pick commit message to keep, squash other messages
http://gitready.com/advanced/2009/02/10/squashing-commits-with-
rebase.html