解决向github上push报 error: failed to push some refs to 'xxxxx' 问题

1、问题

  向github上push 代码时,报  error: failed to push some refs to 'xxxxx'  错误,如下:

解决向github上push报 error: failed to push some refs to 'xxxxx' 问题

 

 2、原因分析

  原因是远程仓库与本地仓库中的文件有差异,我这个是新建的仓库,远程仓库上面有 README.md 和 LICENSE 文件,而本地没有。

3、解决方法

  

git pull --rebase origin master

  说明:该命令用于从另一个存储库或本地分支获取并集成(整合)。取回远程主机某个分支的更新,再与本地的指定分支合并。 

执行之后,重新push就可以,如下:

  解决向github上push报 error: failed to push some refs to 'xxxxx' 问题

 

相关文章:

  • 2021-09-05
  • 2021-04-19
  • 2021-07-07
  • 2022-01-04
  • 2021-05-24
  • 2021-10-08
猜你喜欢
  • 2021-05-01
  • 2022-12-23
  • 2022-01-25
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案