git rebase:我在来自不同提交的相同文件上遇到冲突

git rebase: I'm getting conflicts on the same files from different commits

这是我的情况: 通过约 30 次提交对功能分支进行了各种更改 需要从 Github 中提取 develop-branch 并将其与 feature-branch 上的更改合并。

这是我尝试过的:

git pull --rebase origin develop
CONFLICT (content): Merge conflict in users.py

那我解决冲突,

git add users.py
git status              # everything looks clean, couple of untracked files
git rebase --continue
return: No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
   git rebase --skip

CONFLICT # 这次,相同的文件但不同的提交!

所以基本上,当我解决冲突并暂存每个文件时,引入了其他冲突。我注意到在我对 feature-branch 所做的 every 提交时,feature-branch 和 develop-branch 之间存在冲突! 我该如何解决这个问题??

当你做一个变基时,git 所做的是在两个分支上使用最后一个公共提交并首先应用上游更改 然后 它把所有本地 上游更改之上的分叉之后进行的提交。在此变基过程中,git 将提交逐一应用于上游更改。

因此,您的功能分支中的所有更改可能会以某种方式与开发分支发生冲突,除非它们是开发分支中不存在的文件的一部分