我正在提交并推动更改。 这些更改已成功完成。 然后,我试图推动它失败了。
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin mpgf:mpgf
Pushing to https://github.com/XXXXXXXXX
To https://github.com/XXXXXXXXX
! [rejected] mpgf -> mpgf (non-fast-forward)
error: failed to push some refs to 'https://github.com/XXXXXXXXX'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
然后,我试图拉(现在我看到有一些变化),但它失败了:
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
git -c diff.mnemonicprefix=false -c core.quotepath=false pull --no-commit origin mpgf
You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.
Completed with errors, see above.
它发生的原因是什么?我小心翼翼地推动我的更改的步骤是什么?
P.S。现在我看到我必须进行一些更改,并且我必须进行一次更改。
答案 0 :(得分:0)
您可以打开一个新分支,跟踪您想要提取的远程分支(使用“git branch --track”)。然后从远程分支中提取更改。然后签出原始分支并将新分支合并到其中。现在您的远程和本地分支是相同的,您可以推送。