拉取报错:git -c diff.mnemonicprefix=false -c core.quotepath=false –no-optional-locks fetch origin
git -c diff.mnemonicprefix=false -c core.quotepath=false –no-optional-locks pull –no-commit origin prod
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
推送报错:
git -c diff.mnemonicprefix=false -c core.quotepath=false –no-optional-locks push -v –tags origin prod:prod
Pushing to http://
.git
To http://
.git
! [rejected] prod -> prod (non-fast-forward)
error: failed to push some refs to ‘http://*****.git’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
通过SourceTree 代码提交git远程仓库时,有别人在提交,我没执行merge操作,结果造成
执行推送,推送不到远程仓库;
执行拉取,也拉取不到本地仓库。
解决方法:
1、git merge –abort
2、git pull
3、通过SourceTree拉取吧,拉取成功
4、通过sourceTree推送吧,推送成功