我知道这个不断变化的分支基础技巧,并且在这个问题上没有用:GitHub pull request showing commits that are already in target branch
就我而言,我正在从我从事的其他分支获取我的提交,然后再切换到分支。我该如何解决?
master
(或您要合并到的分支)中创建一个完整的新分支,然后仅从旧分支中逐一挑选您要在PR中显示的提交。然后您需要使用原始分支名称强制推送到github。git checkout -b new_attempt origin/master
git cherry-pick <commit1>
git cherry-pick <commit2>
...
git push --force origin new_attempt:mybranch