【发布时间】:2018-10-11 04:06:54
【问题描述】:
我已将远程存储库添加到我正在使用的文件夹中:
git remote add origin https://github.com/<username>/<repo>.git
如果我输入:
git pull origin master
我明白了:
From https://github.com/<username>/<repo>
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
我也试过了:
$ git pull origin master --allow-unrelated-histories
但我明白了:
From https://github.com/...
* branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
<files>
Please commit your changes or stash them before you merge.
Aborting
【问题讨论】:
-
您是否正在启动新的存储库?
-
技术上是的,因为它没有找到我正在工作的存储库。所以我输入了这个:``` git remote add origin github.co/username/xxxxx.git ```
-
git pull origin master --allow-unrelated-histories。见这里stackoverflow.com/questions/37937984/…