git : error: failed to push some refs to xxxxx

原因:本地和远程的文件应该合并后才能上传本地的新文件

解决方案:

1、先拉下来,会自动合并的(不用操心)

git pull origin master

如果上述代码报错,用:

git pull origin master --allow-unrelated-histories

2、再上传

git push -u origin master

参考文章:https://blog.csdn.net/winnershili/article/details/78888548

猜你喜欢

转载自www.cnblogs.com/xiangsui/p/11511320.html