git error: failed to push some refs to

git错误 error: failed to push some refs to

错误原因

远程库与本地库不一致

解决办法

远程库中的更新合并到(pull=fetch+merge)本地库中,然后再进行提交。
使用命令:

git pull --rebase origin master

–rebase 是取消掉本地库中刚刚的commit

pull成功后再执行:

git push origin master

你可能感兴趣的:(error:,failed,to,push,some,refs,to,git)