- First off, try to make commits as small and incremental as possible, so that there is not a huge chunk of code that changes with a single commit.
- No one pushes to
master
ordevelopment
- Everybody works by basing their work off
development
branch, which in turn is based offmaster
. For example, suppose you needed to add gui to the project. You can create a branchadd-gui
derived from thedevelopment
branch to implement GUI.
git checkout -b add-gui develop
- When you are done with your feature, merge back without fast forwarding like (avoid fast forwarding as it results in loss of history)
git checkout development
git merge --no-ff add-gui
- You can now safely delete your own feature branch, and push the changes to remote
development
branch
git branch -d add-gui
git push origin development
- Eventually, we merge back
development
branch back into themaster
branch