Clean Git Commit History
§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-a
to capture the changes in feature-a-dev
whenever it reaches one milestone.
1 | git checkout feature-a |
§feature-a >> master
1 | git checkout master |
§Conclusion
Following the above practice, hopefully, you could make sure master always has clean and informative history.