Reputation: 50786
I need to only add a part (a directory) of another project within my "superproject", so I'd like to know if it is possible with git-submodule to only add a certain directory from another repository to my project?
(I'm using git for the deployment as well, so I do not want to stuff my project with other unnecessary things.)
Upvotes: 3
Views: 959
Reputation: 129566
You could make a bare repo and then just use git checkout
with the --work-tree
and --git-dir
parameter after the git command and specify the branch/tag you want and then specify the path you want after the --
file specifier option. Example:
git --git-dir=somedir --work-tree=someotherdir checkout somebranchortag -- somepath
Hope this helps.
Upvotes: 1