A Git workflow for agile development.
First pull from master, to have the latest version of the repo:
git pull origin master
Checkout a feature branch, name it with the issue id of the story you are working on and a short description. For example if you are working on #42: User can upload pictures, do something like
git checkout -b 42-picture-upload
NOTE: Git does not allow spaces in branch names, so seperate with - or _!
Do your work and commit whenever somethin is working (yay!). Always include the issue id in your commit messages and write a understandable commit message which makes sense. Otherwise pay the rest of the team some coffee!
git commit -m "#42 Added upload dialogue to gallery.html
Otherwise it may kill you.
git fetch origin master
git rebase origin/master
If you want to hide the hundreds of stupid commits needed to implement a simple feature, squash them together.
git rebase -i origin/master
In the now magically opened file change the pick
in front of the unwanted commits to squash
, they will be squashed. Save and close. In the next view enter a new commit message and save and close again.
Done with your feature? Great. Of course you tested a lot and now are ready to merge the branch back to master.
git checkout master
git merge 42-picture-upload
Don't forget to push the master branch back to your remote.
Bugs should be tracked in issues, so they have their own issue id. Follow the same workflow as above, use the bugs issue id as branch number. Add a prefix like bug-
or hotfix-
to make everything clear.
By fetttobse