Git无法push远程仓库 failed to push some refs to 'https://github.com/test'

git push 远程仓库时,出现以下类似错误,failed to push some refs to 'https://github.com/test'。

Git无法push远程仓库 failed to push some refs to 'https://github.com/test'_第1张图片

解决方案:

这个问题是因为远程库与本地库不一致造成的,那么我们把远程库同步到本地库就可以了。 

git pull --rebase origin master

Git无法push远程仓库 failed to push some refs to 'https://github.com/test'_第2张图片

REBASE 1/2:2表示有两个冲突文件,rebase冲突是一个一个解决的,1表示当前需要解决是第一个冲突文件

更改完冲突文件后,运行命令:

git add .

然后提交更改:

git rebase --continue

如果不想提交这个更改可以跳过:

git rebase --skip

全部冲突文件解决完了后,分支就会变回来了

然后再push到主分支即可

Git无法push远程仓库 failed to push some refs to 'https://github.com/test'_第3张图片

 

你可能感兴趣的:(T-Git)