Github新创建repository,push或者pull失败
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/379
今天兴高采烈的创建了一个readme.md文件,
然后用git pull的时候,怎么也pull不下来这个readme.md文件,看起来好像只是更新了first_commit的信息。
push失败原因:
远程仓库和本地仓库的master分支不一致导致失败,需要先pull远程仓库的该分支。
因为本地和远程是两个不同的项目。(指远程多了readme.md文件)
pull失败解决办法:
git pull origin master --allow-unrelated-histories
参考文档:
[1] Github新创建repository,push或者pull失败
This article was last edited at 2020-07-25 15:01:32