赞
踩
今天在创建远程仓库,关联远程仓库后pull下来的时候失败
λ git pull
fatal: refusing to merge unrelated histories
fatal: refusing to merge unrelated histories
这里的问题的关键在于:fatal: refusing to merge unrelated histories
你可能会在git pull或者git push中都有可能会遇到,因为这两个分支可能没有取得联系。那么怎么解决呢?
在你操作命令后面加–allow-unrelated-histories
例如:
git pull origin master --allow-unrelated-histories
Administrator/My-demo (master)
$ git pull origin master --allow-unrelated-histories
From gitee.com:tuogu/typescript-demo
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
如果你是git merge 报fatal: refusing to merge unrelated histories
同理:
git merge master --allow-unrelated-histories
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。