Git nested repos
I have 2 repos, A and B and I want to nest B inside A (add it as a sub folder). I just placed B inside A, but the problem is that when I do any modification on repo B, it’s not added or even considered in Reop A.
What change or modification should I do to make it considered as repo A?
- How do I commit live code using GIT?
- Upload a folder with more than one app to github with git
- Where is my commit and why I can't push?
- git add common text for the same file in two branches with little variation
- Keeping modified library files updated in git
- Reverse last push on Github.
Considering that repo A is private and repo B is public on GitHub, would that make any difference also?
One Solution collect form web for “Git nested repos”
You should implement B as a submodule.
git submodule add git://yourdomain.com/path/to/B path/to/B
git://yourdomain.com/path/to/B is the distant path to B.
path/to/B is the local directory where you want to put it in A.
Then every time you’ll clone the repo A, you will have to do a
git submodule update. And B will be up to date.
Capistrano manages it automatically if you define the
:git_enable_submodules to true.