List submodules in a Git repository

You could use the same mechanism as git submodule init uses itself, namely, look at .gitmodules. This files enumerates each submodule path and the URL it refers to. For example, from root of repository, cat .gitmodules will print contents to the screen (assuming you have cat). Because .gitmodule files have the Git configuration format, you … Read more

Pull latest changes for all git submodules

If it’s the first time you check-out a repo you need to use –init first: git submodule update –init –recursive For git 1.8.2 or above, the option –remote was added to support updating to latest tips of remote branches: git submodule update –recursive –remote This has the added benefit of respecting any “non default” branches … Read more

Why is git submodule not updated automatically on git checkout?

git checkout –recurse-submodules was added to git 2.13 This is mentioned on the release notes at: https://github.com/git/git/commit/e1104a5ee539408b81566066aaa6963cb87d5cd6#diff-c24776ff22455a30fbb78e378b7df0b0R139 submodule.recurse option was added to git 2.14 Set as: git config –global submodule.recurse true man git-config says: Specifies if commands recurse into submodules by default. This applies to all commands that have a –recurse-submodules option. Defaults to false. … Read more

How to track untracked content?

You have added vendor/plugins/open_flash_chart_2 as “gitlink” entry, but never defined it as a submodule. Effectively you are using the internal feature that git submodule uses (gitlink entries) but you are not using the submodule feature itself. You probably did something like this: git clone git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2 git add vendor/plugins/open_flash_chart_2 This last command is the problem. … Read more

No submodule mapping found in .gitmodule for a path that’s not a submodule

No submodule mapping found in .gitmodules for path ‘OtherLibrary/MKStore’ when $ git submodule update –init I didn’t know why the error occur. After spending a minute and found the answer in stackoverflow. $ git rm –cached OtherLibrary/MKStore and then update the submodule again. It’s working fine. http://en.saturngod.net/no-submodule-mapping-found-in-gitmodules