How do I "commit" changes in a git submodule?

The Solution to How do I "commit" changes in a git submodule? is


A submodule is its own repo/work-area, with its own .git directory.

So, first commit/push your submodule's changes:

$ cd path/to/submodule
$ git add <stuff>
$ git commit -m "comment"
$ git push

Then, update your main project to track the updated version of the submodule:

$ cd /main/project
$ git add path/to/submodule
$ git commit -m "updated my submodule"
$ git push

~ Answered on 2011-04-04 18:58:01


Most Viewed Questions: