Search code examples
gitgit-submodules

How to add a repo folder to its parent folder's repo


A folder predis in my repository, is itself a git repository. I'm having trouble adding it to my repo (without its .git folder).

When I do git add predis, nothing happens. Similarly, when I do git status it does not show up.

How can I add the /predis folder, when it itself is a git repository (from someone else's repo)?

also, while looking into this, i noticed that git status --ignored doesn't work, which would have been nice to analyze this. git add -f predis does not work either.


Solution

  • What @meagar said about submodules may be what you need. Issue the command:

    git submodule add git:<url for submodule> path/to/save.

    The git-scm book has further details: http://git-scm.com/book/en/Git-Tools-Submodules