错误"failed to push some refs to"的解决办法

执行git push文件的时候出现下面的错误:
To https://git.ms.netease.com/kanghuaisong/Git_demo.git
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to ‘https://git.ms.netease.com/kanghuaisong/Git_demo.git’
hint: Updates were rejected because a pushed branch tip is behind its remotehint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the ‘push.default’ configuration variable
hint: to ‘simple’, ‘current’ or ‘upstream’ to push only the current branch.
问题原因:
push 分支的代码已经跟远程分支的代码不一致了
解决方法:
git pull –rebase
git config –global push.default current

你可能感兴趣的:(git)