Why I cannot push my code to github?

后端 未结 2 690
忘了有多久
忘了有多久 2021-01-15 18:37
$git push origin master
To git@github.com:dimitar9/first_app.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to \'git         


        
2条回答
  •  梦谈多话
    2021-01-15 19:11

    You need to do a git pull first.

    Update with explanation: Because you don't have the latest code, git forces you to do the merge on your side before pushing changes. This is to help prevent losing changes other people have made.

    If you have any conflicts, you should review them to decide whether the local or remote code is what you want to commit.

提交回复
热议问题