您的位置:首页 > 大数据 > 人工智能

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

2014-12-03 16:59 288 查看
用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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐