git-subtree pull complications

后端 未结 4 1565
深忆病人
深忆病人 2020-12-14 16:49

We have been trying to get git-subtree working on a project (with git version 1.7.9.4) and have run into a bit of a complication. Someone else previous added the subtree wit

4条回答
  •  悲哀的现实
    2020-12-14 17:22

    I had the same problem, and in my case it seems to be due to the initial subtree commit being merge-squashed into the master branch.

    Looking through the subtree source I found this: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.sh#L224

    It looks like subtree greps your git log for git-subtree-dir: foo but doesn't find a suitable commit. Try git log --grep="git-subtree-dir: foo/*\$", and if there's something weird with that commit, such as it being a merge commit, that could be the issue.

    Just pulling without squashing worked for me, apart from the annoying merge conflicts. I did that in a temporary branch which I then git merge --squashed into another branch to avoid a messier history. It could've been rebased instead too of course.

提交回复
热议问题