Search code examples
gitgit-submodules

Add git submodule with files?


Is there a way to add a git submodule with all of its files? I really just need the files as a subdirectory with an easy way to run the update with git fetch and git pull.

I tried git cloning the repository but that added the directory as a submodule without the files.


Solution

  • Perhaps you want git subtree merge?

    Something like:

    git subtree add --prefix [submodule name] [submodule url] master
    

    See http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/