rebase 基本上会撤消您的所有更改(EL),将您的代码更新为 D,然后在 D 之上进行所有更改(EL)。这并不是您真正想要的。
我认为你应该做一个 git 合并。
git checkout cat
git merge dog
从 git-merge 手册页:
将来自命名提交的更改(从它们的历史从当前分支分歧的时间开始)合并到当前分支中。git pull 使用此命令来合并来自另一个存储库的更改,并且可以手动使用该命令将更改从一个分支合并到另一个分支。
Assume the following history exists and the current branch is "master":
A---B---C topic
/
D---E---F---G master
Then "git merge topic" will replay the changes made on the topic branch since it diverged from master
(i.e., E) until its current commit (C) on top of master, and record the result in a new commit along
with the names of the two parent commits and a log message from the user describing the changes.
A---B---C topic
/ \
D---E---F---G---H master