I want to update the code modified in my personal branch to the public development branch. After merging my branch into the local development branch, I want to update to the remote through push
, but something went wrong, and recently Often encountered. The following is my error message
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)
Newbie, please give me advice
滿天的星座2017-05-02 09:36:48
I think if your local development branchdevelop
可能不是最新的,就是和远程的开发分支develop
不是同一版本。这种问题我遇到过,一般你在执行git push origin 分支
之前最好执行一下git pull origin 分支
is updated to the same version locally and remotely, then there will be no problem. You can try it again after executing the following command
#先执行
git pull origin develop
#在执行
git push origin develop
Hope it helps you
伊谢尔伦2017-05-02 09:36:48
Direct translation of this English sentence, it means that in addition to your commit, there are things in the remote version that you don’t have locally. Please git pull
check it first
仅有的幸福2017-05-02 09:36:48
He reminds you that the branch you want to push to has commits that you don’t have locally. It is recommended to git pull the merge first and then push.
我想大声告诉你2017-05-02 09:36:48
When pushing, it is very likely that someone else has submitted new code to the remote branch, so you need to pull the code first to make the local code up to date. If there is a conflict, resolve it and then push the code