Git push failed, “Non-fast forward updates were rejected”

后端 未结 12 1733
轻奢々
轻奢々 2020-12-02 06:12

I\'ve edited my GIT repositories via Git Online. After I tried to push my local code changes, I got an error:

Git push failed, To prevent from losing histor         


        
12条回答
  •  攒了一身酷
    2020-12-02 06:55

    Before pushing, do a git pull with rebase option. This will get the changes that you made online (in your origin) and apply them locally, then add your local changes on top of it.

    git pull --rebase
    

    Now, you can push to remote

    git push 
    

    For more information take a look at Git rebase explained and Chapter 3.6 Git Branching - Rebasing.

提交回复
热议问题