我的想把我的个人分支修改的代码更新到公共的开发分之中,我把我的分支合并到本地开发分支之后,想通过push
更新到远程,结果出错了,而且最近经常遇到。如下是我出错的信息
Admin@Administrator MINGW64 /d/htdocs/work.local.com/www-local-com (develop) $ git merge lernado Updating 764de39..7717317 Fast-forward controllers/ListsController.php | 1 - 1 file changed, 1 deletion(-) Admin@Administrator MINGW64 /d/htdocs/work.local.com/www-local-com(develop) $ git push origin develop To git@git.develop.com:admin.site/www-develop-com.git ! [rejected] develop-> develop (fetch first) error: failed to push some refs to 'git@git.develop.com:admin.site/www-develop-com.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. Admin@Administrator MINGW64 /d/htdocs/work.local.com/www-local-com (develop)
新手,求大神们指教
push 的时候远程分支很有可能别人已经提交了新的代码,所以你需要先pull下代码,使本地代码是最新的,如果存在冲突解决一下,然后再去push代码
他提示你了,你要push到的分支上有你本地没有的commit,建议先git pull合并后再push.
直接翻译这段英文,意思是远程的版本里除了你这个commit之外还有你本地没有的东西,要求你先git pull
一下
我觉得你本地的开发分支develop
可能不是最新的,就是和远程的开发分支develop
不是同一版本。这种问题我遇到过,一般你在执行git push origin 分支
之前最好执行一下git pull origin 分支
,保证本地和远程为同一版本在更新就没问题了。你执行如下命令之后再试试看
#先执行 git pull origin develop #在执行 git push origin develop
希望对你有帮助
我现在使用的是2.5版本的, 比较稳定, 我尝试安装2.1版本, 但是每次都是安装的2.1.8, 所以看不到具体的源码, 你最好还是升级下吧, 方便些