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

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

1、问题

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

 2、原因分析

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

3、解决方法

  

git pull --rebase origin master

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

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

  

猜你喜欢

转载自www.cnblogs.com/BillyYoung/p/12784905.html