Say we have three branches:

  • master : the one whole team collaborate on
  • feature-a : merging candidate for this feature
  • feature-a-dev : daily development for this feature; might contain a lot errors in the commits as the developers learn more on this area


master >> feature-a

feature-a is rebased onto master to pick up all the changes done by other members in the team.

git checkout feature-a
git rebase master # hopefully, there's only small conflicts, if any

feature-a-dev >> feature-a

Create one commit on feature-ato capture the changes in feature-a-dev whenever it reaches one milestone.

git checkout feature-a-dev
git checkout -b feature-a-dev-tmp
git reset feature-a / git reset --soft feature-a
git checkout feature-a
git add / git add --patch / editor-supported-diff-adding
git commit <milestone_msg>
git checkout feature-a-dev
git reset --hard feature-a-dev-tmp
git branch -D feature-a-dev-tmp

feature-a >> master

git checkout master
git merge feature-a / git merge --no-ff feature-a


Following the above practice, hopefully, you could make sure master always has informative history.