首页 > 其他分享 >git推送错误:error: failed to push some refs to 'https://github.com/xxxxxxxxxx.git'

git推送错误:error: failed to push some refs to 'https://github.com/xxxxxxxxxx.git'

时间:2022-11-07 15:47:10浏览次数:73  
标签:github refs some git 报错 库中 push 推送

git推送到github仓库时,报错,如图

报错原因:出现错误的主要原因是github中的README.md文件不在本地代码目录中

 

解决方案:

1、输入以下命令,将远程库中的更新合并到(pull=fetch+merge)本地库中,–-rebase的作用是取消掉本地库中刚刚的commit,并把他们接到更新后的版本库之中

$ git pull --rebase origin master

 

 

2、 输入以下命令,重新推送,出现下图即推送成功

git push -u origin master

 

3、再到github中查看是否推送上数据

 

标签:github,refs,some,git,报错,库中,push,推送
From: https://www.cnblogs.com/poppyCHN/p/16865994.html

相关文章