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

后端 未结 12 1727
轻奢々
轻奢々 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:57

    Using the --rebase option worked for me.

    • git pull --rebase

    Then push to the repo.

    • git push

    E.g.

    git pull origin master --rebase

    git push origin master

提交回复
热议问题