不能使用git子树拉

时间:2016-10-28 15:47:14

标签: git git-subtree

我试图从遥控器拉到我的仓库中的文件夹中。使用时:

git subtree pull --prefix my-local/folder my-remote master

我收到以下错误:

fatal: refusing to merge unrelated histories

我在其他post中读到我可以使用--allow-unrelated-histories选项,但当我这样做时,我会error: unknown option --allow-unrelated-histories (我把选项放在最后)

我使用的是git版本2.10.1和Windows 10

非常感谢任何有关如何推进这方面的帮助或想法!

2 个答案:

答案 0 :(得分:1)

我有同样的问题,我通过添加--squash选项让它工作。此选项将子树更改合并为单个提交。我不确定为什么会这样,但它显然解决了历史问题。

答案 1 :(得分:-1)

试试sudo add-apt-repository ppa:git-core/ppa && sudo apt-get update 然后使用--allow-unrelated-histories

相关问题