我已将远程存储库添加到我正在使用的文件夹中:
git remote add origin https://github.com/<username>/<repo>.git
如果我输入:
git pull origin master
I get:
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
你需要要么reset
or commit
首先你的改变:
git reset --hard
or:
git commit -m "saving changes..."
然后你可以这样做:
git pull origin master --allow-unrelated-histories
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)