tags:

views:

27

answers:

1

Say I've got a project under git version control. Within that project, I have a folder called "third_party_tools." And within that folder, I've got a folder called "some_open_source_tool," which was cloned from github.

Will this cause problems? Can I check the tool into git for my project and retain the ability to pull from github if there are updates? Or is it not permitted to have one git repo inside another?

+5  A: 

It is permitted to have one git repository inside another. If you want to check the tool into your outer project, I would recommend you look into submodules, which allow you to keep nested git projects in sync properly.

Brian Campbell
Well, this is clearly the right answer, but it looks like it could create confusion on our team - people who pull the superproject will get empty folders initially for the subproject and have to figure that out, etc. I may just remove the subproject's .git folder and treat it as our own, updating by hand if necessary. Anyway, thanks for the answer. If anybody else wants to read more about this, Pro Git is, as always, a good resource. http://progit.org/book/ch6-6.html
Nathan Long