关于git 的问题(环境为 mac )

青鸾之旅 发布于 2013/09/03 23:32
阅读 7K+
收藏 0
Git


我 push 时出现的问题求解

-Air:NFC_beta darkh$ git push

To http://git.oschina.net/lightyear/nfc_beta2.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'http://git.oschina.net/lightyear/nfc_beta2.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

加载中
0
卖切糕大叔
卖切糕大叔

楼上是正解,你得学会看错误提示啊,里面说的很清楚了

hint: Updates were rejected because a pushed branch tip is behind its remote 

提示:由于你推送的分支落后于远程分支,更新失败。这说明你上次pull之后有人改动了源文件
hint: counterpart. Check out this branch and merge the remote changes 

提示:副本。查验(git checkout)你的分支并且与远程分支合并(git merge)
hint: (e.g. 'git pull') before pushing again. 
提示:例如再次推送前使用 git pull。这句告诉了你改怎么做

hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

提示:通过命令git push --help查看手册获取详情。这句告诉你怎么获得git push的使用方法

0
朱__朱
朱__朱
你先pull一下就好了
0
王振威
王振威

你的版本比较落后,需要先合并远程分支后,才可以push,最简单的命令就是 git pull

返回顶部
顶部