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

来源:互联网 发布:数据库系统工程师希赛 编辑:程序博客网 时间:2024/06/05 16:14

执行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

0 0
原创粉丝点击