I’ve added a submodule in my main git folder tree and haven’t changed anything but it’s showing up modified. What do I do about this?
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: example.com/soundmanager
#
no changes added to commit (use "git add" and/or "git commit -a")
I’ve tried a git submodule update, but it doesn’t do anything.
The way that the status of git submodules is reported has changed a lot over recent versions of git, so you should really include the output of
git --versionas well for us to be able to help accurately.However, in any case, the output of
git diff example.com/soundmanagershould tell you more. If you see output with the same commit name, but with-dirtyadded to the new version, e.g.:… than that means that
git statusin the submodule isn’t clean – trycd example.com/soundmanagerand thengit statusto see what’s going on.On the other hand, if you see different commit versions, e.g.:
… that means that the version that your submodule is at (i.e. what you see from
cd example.com/soundmanager && git show HEAD) is different from the version committed in the main project’s tree (i.e. what you see fromgit rev-parse HEAD:example.com/soundmanager). If the former is right, you should add and commit the new version of the submodule in your main project, with something like:On the other hand, if the latter is what you want, you can change the version that the submodule is at with: