The goal of this page is to suggest yet another one flow how to develop with Git. The goal of the flow itself is to make history more clearer and linear.
Given two branches develop and M42_feature_branch
We already did some development in the feature branch and even passed review. Next step is to merge changes into develop
git checkout develop git merge --squash M42_feature_branch git ci -am "meaningful message about implemented feature"
git fetch
git rebase origin/develop
# push changes
git push origin/develop
In the snippet above there are two important steps:
--squashused in merge. Some advantages- takes a series of commits and squash them down into a single commit
- history free of messages like "Merge branch X into Y"
fetch/rebaseinstead ofpullcommand.- history free of messages like "Merge branch X into Y"