I\'m trying to get just a folder from an external github repo to use in my project.
I want my project setup to be like this:
-my_project
-submodu
If you:
git submodule add http://github.com/user/submodule.git
directly under my_project
, you should end up with the desired organization of directories.
From git submodule add man page:
The optional argument
<path>
is the relative location for the cloned submodule to exist in the superproject.
If<path>
is not given, the "humanish" part of the source repository is used ("repo" for "/path/to/repo.git
" and "foo
" for "host.xz:foo/.git
").
What you want to do is not feasible because you cannot clone a part of a repository.
See details in duplicate How to change a git submodule to point to a subfolder?
just
git submodule update --init --recursive
in the root-directory of your project and it should do what you want