gitgit-submodules

Git submodule push


If I modify a submodule, can I push the commit back to the submodule origin, or would that require a clone? If clone, can I store a clone inside another repository?


Solution

  • A submodule is nothing but a clone of a git repo within another repo with some extra meta data (gitlink tree entry, .gitmodules file )

    $ cd your_submodule
    $ git checkout master
    <hack,edit>
    $ git commit -a -m "commit in submodule"
    $ git push
    $ cd ..
    $ git add your_submodule
    $ git commit -m "Updated submodule"