5

We are having an issue where the command:

git subtree pull --prefix=Root squash root master

is pulling code from the root repository into the . directory of our repository instead of the Root directory.

This command has worked fine in the past. The only difference is it has been a while since we have done a pull, so there are quite a few changes to merge.

I can't seem to find any official documentation on "git subtree", but there is a lot on the subtree merge strategy used with "git pull -s subtree". What is the difference (if any)?

Joe Enzminger
  • 10,882
  • 2
  • 47
  • 75

1 Answers1

7

git subtree is an "alternative to submodules", see https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt or https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec

git pull -s subtree or git merge -s subtree selects the subtree merge strategy: http://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging

See also the answer to When to use git subtree?

drRobertz
  • 3,270
  • 1
  • 11
  • 22