当我输入 > git subtree add --prefix=<some dir> --squash <some repo> master
我收到消息 'master' does not refer to a commit
.如果我将“master”更改为 sha,我仍然会收到警告。 repo 是有效的,主人存在于我试图 pull 入的 repo 中。
最佳答案
我最终找到了this commit重要的信息是
This patch:
- relaxes the check the argument in "git subtree add " (previous code would not accept a ref name that does not exist locally too, new code only ensures that the ref is well formatted)
我的问题是我的本地存储库没有名为 master 的分支(语义版本控制)。 简单的解决方法是创建一个名为 master 的本地分支(或者您尝试从中提取的分支的任何名称。这解决了此处看到的问题:Adding git subtree from a branch Geoff Ryan 可以创建一个名为 cow 的本地分支并成功使用了子树)
这应该有望在 git 1.9 中得到解决,但是对于使用早期版本的任何人,我希望这可以让您避免一些挫败感。
关于git - 当我使用 git-subtree 时,为什么我被告知 "' master' does not refer to a commit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21500722/