I’m using git + pathogen to track my vim plugins. I have a git repo in my .vim folder, and all my plugins are in the bundle folder.
To add a new plugin I do:
git submodules add git://github.com/plugin.git bundle/plugin
It works out of the box for most plugins (it clones the new repo to the location specified and I’m happy with my vim).
With some repos, however, it simply does not work. By not working I mean:
- After running
git submodules addit doesn’t output anything (unlike the clone information). - An empty folder is created in
bundle/plugin - .gitmodules and .git/config are updated to reflect the changes (opening .gitmodules you can see the new repo, just like all the others)
I was told I should run git submodule init && git submodule update after adding a new submodule.
Is it possible that forgetting to do so may have caused the issues?
Submodules need to be registered in 3 places. Ensure that these are properly set up:
.gitmodulesfile has an entry.git/confighas an entrygit ls-tree sha1of the tree where the submodule is corresponds to a commit in the submodule