How do I resolve conflicts with Git?

前端 未结 3 943
名媛妹妹
名媛妹妹 2020-12-30 09:52

I have a pull request for which GitHub tells me \"This branch has conflicts that must be resolved.\" I tried:

~/src/networkx: git rebase origin/master
Curren         


        
3条回答
  •  不思量自难忘°
    2020-12-30 10:17

    First you need to make sure you have the upstream remote repository set:

    git remote add upstream git@github.com:networkx/networkx.git
    

    Then You need to fetch upstream/master and then rebase on that. It's something along the lines of:

    git fetch upstream
    git checkout 
    git rebase upstream/master
    

    As git replays your work on top of upstream/master, conflicts will be raised and you'll have to dive into the files to resolve them. Then you:

    git add 
    git rebase --continue
    

提交回复
热议问题