假设我有以下三个提交:
c - Third Commit
b - Second Commit
a - First Commit
我使用以下命令执行交互式变基(如另一个StackOverflow线程所述)
问题在于有时候,当我完成操作后,提交记录被合并为一个单独的提交(例如我的示例中的最老的提交$ git rebase --interactive bbc643cd^
In the default editor, modify 'pick' to 'edit' in the line whose commit you want to modify. Make your changes and then commit them with the same message you had before:
$ git commit --all --amend --no-edit
to modify the commit, and after that
$ git rebase --continue
a
)。看起来这可能与需要解决的合并冲突有关,所以我怀疑我在解决后继续操作时出了问题。在解决合并冲突后,我不确定是否只需要执行
git rebase --continue
,还是需要同时执行$ git commit --all --amend --no-edit
和git rebase --continue
。似乎在两种情况下,我都会得到合并的提交记录,但我不确定。我做错了什么?
commit --amend
命令,那么你将修改 之前 的提交记录。 - Tobia Tesan