我还在逐渐学习Git的一些更高级的功能...
鉴于以下的历史记录,我该如何清理主题分支的合并,以便它们出现在历史记录中作为一个提交?
[master] - - - - - - - C - - -
\
[feature] - A - - B - - D -
理想情况下,我希望在D处将[feature]与[master]合并,然后将[feature]合并到[master]中,使A和B变为孤立状态。
我原本以为可以简单地通过以下方式实现:
$ git rebase master # on feature branch
$ git co master
$ git merge --no-ff feature
然后使用以下方法清理孤立的提交:
$ git gc --prune=now --aggressive
这仍然会在历史记录中留下A和B - 我有遗漏什么吗?