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

后端 未结 12 1744
轻奢々
轻奢々 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 07:13

    I've had the same problem.
    The reason was, that my local branch had somehow lost the tracking to the remote counterpart.

    After

    git branch branch_name --set-upstream-to=origin/branch_name
    git pull
    

    and resolving the merging conflicts, I was able to push.

提交回复
热议问题