Git pull error: Your local changes to the following files would be overwritten by merge:

前端 未结 5 955
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 09:21

I am trying to pull changes from remote branch but getting an error which doesn\'t make sense

when I do

git pull

I get back

<
5条回答
  •  难免孤独
    2020-12-13 10:19

    You should:

    • fetch (updating all remote tracking branches, like origin/master)
    • rebase your current branch on top of origin/master in order to replay your 2 commits on top of the 7 updated commits that you just fetched.

    That would be:

    git checkout master
    git fetch
    git rebase origin/master
    

    A shorter version of the above set of commands would be the following single command:

    git pull --rebase
    

提交回复
热议问题