1

I have a project called myproject in a repository with the link say www.abc.com I have to add a submodule to it and the submodule is present in a different repository say www.xyz.com

The submodule is under libs->android->appirator

I have followed this link http://www.git-scm.com/book/en/v2/Git-Tools-Submodules. So when I execute this below command I am able to get the total content of libs folder in my project.

$ git submodule add myrepository link

But after the commit when I clone the project www.abc.com I am not getting the project with submodule

I know I have to create a symbolic link.I went through a lot of links but failed to do so.

Please suggest me whan can be done here so that when the user clones it he should get the submodule also.

Help is always appreciated, Thanks

1 Answer 1

3

You can call this:

git clone --recursive <your_git_url>

to get all the submodules for your repo, and if your git version is higher than 1.6. If not, then you will need to run:

git submodule init
git submodule update

after cloning.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for the suggestion,I have done this but I didnt get the submodule
Note that the second option (git submodule init, git submodule clone) also works with newer versions of Git. The first option clones a new repository, the second initializes and clones submodules in an existing repository.
@Raghav, does your clone contain a .gitmodules file?
Now I am able to get the submodule.My bad I didnt push after commit to an appropriate branch so that was the issue. thanks for your time and +1 for nice explanation.
so now my question is if i get the submodule i am getting the few other subfolders of it which i dont want.I mean my submodule structure is something like this libs ->android->appirator.so i want only aapirator when i get the submodule?? how can we do this??
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.