有时团队成员会
squash
它们准备合并时提交。在开发过程中,进行多次提交并拥有相当活跃的git历史可能会有所帮助。
git log
然后选择要合并为一个的提交:
git rebase -i HEAD~4
EDITOR
将随每个提交及其消息一起加载,请遵循编辑器中的提示:
pick 01d1124 Adding license
pick 6340aaa Moving license into its own file
pick ebfd367 Jekyll has become self-aware.
pick 30e0ccb Changed the tagline in the binary, too.
# Rebase 60709da..30e0ccb onto 60709da
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
一些团队跟进
this particular workflow
如果他们希望自己的队友这样做,有人会对此表示反对。