报错hint: ‘git pull …’) before pushing again. 解决方法(十分有用)

To github.com:Pandora417/MiMall.git ! [rejected] master ->
master (non-fast-forward) error: failed to push some refs to
[email protected]:Pandora417/MiMall.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.

远程分支上存在本地分支中不存在的提交,往往是多人协作开发过程中遇到的问题,可以先fetchmerge,也就是pull,把远程分支上的提交合并到本地分支之后再push

git pull origin master
git push origin master

如果你确定远程分支上那些提交都不需要了,那么直接git push origin master -f,强行让本地分支覆盖远程分支。(我更喜欢这种)

你可能感兴趣的:(各种异常)