我fork了一个Github Repo,并提出了一些PR做出贡献。在合并之前,父Repo进行了其他的提交。为了获取upstream,我需要解决与upstream产生的冲突。我该如何在本地获取upstream并解决这些更改?
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
获取远程版本库:git fetch upstream
确保你在要合并的分支上运行git rebase upstream/<branch you want to merge to>
。git add
受影响的文件(s)gitrebase--continue
继续变基流程git push --force origin <your branch>
(如果之前已经推送过该分支,则需要使用--force
选项)