`
El_Nino
  • 浏览: 200229 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

git push 失败 error:failed to push some refs to ...

    博客分类:
  • git
阅读更多

用git push代码到远程仓库的时候出现错误

error:failed to push some refs to ...

Dealing with “non-fast-forward” errors

From time to time you may encounter this error while pushing:

$ git push origin master 

To ../remote/ 

 ! [rejected]        master -> master (non-fast forward) 

error: failed to push some refs to '../remote/' 

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes before pushing again.  See the 'non-fast forward'

section of 'git push --help' for details.

 

 

2. 先把git的东西fetch到你本地然后merge后再push

$ git fetch

$ git merge

2句命令等价于

$ git pull 

0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics