Can I add a GIT submodule to the existing project`s root, where files are not joint?

For example, I have Magento project:

app/design/frontend/base/
app/design/frontend/default/
errors/default/
errors/local.xml.sample
...
skin/frontend/base/
skin/frontend/default/
...

… and external Theme for it:

  • Large test dataset in repository
  • VS 2010, Git, and a Solution with Multiple Projects
  • List changed files in git post-merge hook
  • Bower: ENOGIT Git is not installed or not in the PATH
  • Visual Studio Tool for GIT work with Gitblit
  • create an intermediary git repository
  • app/design/frontend/[theme name]/default/
    errors/[theme name]/
    errors/local.xml.[theme name]
    skin/frontend/[theme name]/default/
    README.[theme name]
    

    But when I try to add theme`s repository as submodule to the root of project …

    $ git submodule add -b theme_name git://theme_repository.git .
    '' already exists in the index
    

    Is there any solution?

  • Reverting an interactive git rebase
  • How to remove a commit in git that has no specified branch?
  • GIT - Updating remote repository 'working files'
  • git doesn't upload files in the view/*.jade folder in express.js
  • ways to publish pages in github using markdown without having to install jekyll or other tools
  • Reproducible android builds with git with fast forward merges
  • One Solution collect form web for “Can I add a GIT submodule to the existing project`s root, where files are not joint?”

    You cannot add the content of a submodule in the current directory (already versioned, hence “already existing in the index”).
    You would need to use:

    git submodule add -b theme_name git://theme_repository.git aDirectory
    

    aDirectory would be a new directory not existing yet, and created to be the root folder of your submodule.

    You can then add symlinks to that new folder, in order for app/design/frontend/[theme name] or skin/frontend/[theme name] to renference the right folder.

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