欢迎光临
感谢一路有你

Git 提交时出现错误error: failed to push some refs to

使用git  push提交代码时提示如下错误:

error: failed to push some refs to ‘git@github.com:…..” Updates were rejected because the remote contains work that you do not have locally.

This is usually caused by another repository pushing to

大概原因就是 意思是本地和远程的文件应该合并后才能上传本地的新文件

解决方案

1、先从远程拉下来(pull),会自动合并的

git pull origin master

2、再上传

git push -u origin master

成功解决问题

赞(0) 打赏
未经允许不得转载:王明昌博客 » Git 提交时出现错误error: failed to push some refs to
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

隐藏
变装