1. List all available branches with
git branch -a
2. If you're not in the branch from where you want to start your development, switch to it via
git checkout $branchname
3. You want to work on a issue or a feature concerning this branch? Create your sub-branch via
git checkout -b $yourbranchname
. Please follow naming conventions for
$yourbranchname if your team agreed on any.
4. Do your changes, commit.
5. Optionally, if your separate development takes a long time, consider to merge changes from the higher branch from time to time with
git merge $higherbranch
in order to reduce the number of possible conflicts at the end. Note that you have to use
git pull
inside of
$higherbranch` before you get the most recent changes.
6. At the end of your development merge the changes that were made in the meantime from the higher-branch as described in step 5.
7. In the case of merge conflicts, solve them. Give attention to the messages in
git status
8. Check again if everything was committed. Test your feature.
9. If you're confident that everything is correct, go to the next higher branch (where you want to have your development included) via
git checkout $higherbranch
and merge your feature with
git merge $yourbranchname
.
10. There shouldn't be any conflicts in the last step. If there are, it means that someone published changes in the meantime. Use
git merge --abort
, switch back to your branch and repeat the steps beginning from 6.