§Setup

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

§Routine

§master >> feature-a

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

1
git rebase master feature-a # 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.

1
2
3
4
git checkout feature-a
git merge --squash feature-a-dev
# fix conflicts if any
git commit

§feature-a >> master

1
2
git checkout master
git merge [--no-ff] feature-a

§Conclusion

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