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?

Considering that repo A is private and repo B is public on GitHub, would that make any difference also?

  • Unable to retrieve git commits
  • TeamCity Trigger on Pull Request vs Trigger on Merge
  • Continuous integration with GitHub
  • Setting up Github on a new computer
  • Prompted for password on git pull origin
  • what does “!” do in gitignore files?
  • github: “Link” a Private Repo to an Organization
  • Clone multiple repositories into common parent folder structure
  • 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
    

    Where git://yourdomain.com/path/to/B is the distant path to B.
    And 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.

    Git Baby is a git and github fan, let's start git clone.