我无法推向github。我想我以前通过github网站对我的代码进行了更改,现在它在我git push origin master
时给了我一个提示:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/hrvoojex/telecom-toplist.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我必须这样做:
git pull origin master
之后我将能够做到:
git push origin master
我在我的代码中做了很多更改,因此我不想在上次提交之前丢失我的工作。
答案 0 :(得分:2)
基本上你有两个解决方案:
git push -f origin master