赞
踩
再推送 GitHub 仓库时,出现下面的错误
$ git push origin master
To http://xxxxxx/test.git
! [rejected] master -> master(fetch first)
error: failed to push some refs to 'http://xxxxxx/Android.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
由于你在别的地方(例如新的服务器)提交了另外一份代码,导致GitHub网址上的代码和本地的代码并不一致。所以需要我们先在本地上 pull
GitHub上的代码,在本地解决冲突,然后 push
到GitHub上即可。
git pull origin
git push origin master
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。