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
  • 11,110
  • 3
  • 50
  • 75
  • 1
    `git pull subtree` simply pulls from a remote called "subtree". It has nothing to do with subtrees... – Willem Van Onsem Feb 18 '15 at 20:55
  • 1
    possible duplicate of [What is the difference between git subtree merge and git-subtree](http://stackoverflow.com/questions/11741249/what-is-the-difference-between-git-subtree-merge-and-git-subtree) – drRobertz Feb 18 '15 at 21:44

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,490
  • 1
  • 12
  • 23