当前位置: 代码迷 >> 综合 >> gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘
  详细解决方案

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘

热度:68   发布时间:2023-10-13 00:01:33.0

莫名解决了,记录下命令

1,首先上传新增代码错误:

git add ***

git commit -m ****

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘

2,于是根据提示进行

git pull --rebase origin master

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘

 

3,接着重新 上传,成功

git push origin master

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘

 

 

后记备注:

中间第二步git pull --rebase origin master出现报错
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘

这时执行git stash命令

gitlab中git push origin master出错:error: failed to push some refs to 'git@gitlab.*****‘
再执行git pull –rebase 
最后再执行git stash pop

就可以重新执行下面命令

git pull --rebase origin master

git push origin master
就能成功上传了

  相关解决方案