Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm switching to using submodules for my vim plugins. The usual way of doing this is:

$ git submodule add bundle/a.vim
Cloning into 'bundle/a.vim'...
etc, etc

This works fine with every plugin but Gundo:

$ git submodule add bundle/gundo

There is no output from running this command. The repo is added to .gitmodules and bundle/gundo is created, but is empty except for a .git file.

$ cd bundle/gundo
$ git status
# On branch (null)
# Initial commit
nothing to commit (create/copy files and use "git add" to track)

I'm completely new to submodules. What is special about this repository and how do I correctly add it?

share|improve this question
up vote 2 down vote accepted

Not sure what's going on exactly, but it might be useful if you check/provide the output of the following:

cd bundle/gundo
git remote -v

If the output shows that the repo has the correct origin, then it might just be that you need to checkout the master branch, ie:

cd bundle/gunco
git fetch
git checkout master

If the submodule is still messed up and everything fails, you can try to remove the broken submodule and all traces of it from your repo. You can do this by running the following commands from the toplevel of your git working tree:

git config -f .git/config --remove-section submodule.bundle/gundo
git config -f .gitmodules --remove-section submodule.bundle/gundo
git rm --cached bundle/gundo
rm -rf .git/modules/bundle/gundo
rm -rf bundle/gundo

After this, check git status to make sure everything looks normal. Then attempt to create the submodule again.

If none of this works, then try adding your git version (run: git --version) and your config (run: git config -l) to the question as they might help others figure out what's going on.

P.S: You don't need to paste the entire output of git config -l, and you should probably remove/mask-out, and any other data that you don't want to share on the internet.

Good Luck!

share|improve this answer
Thanks! Completely removing the submodule according to your steps did the trick. I'm not 100% sure, but I think I entered the repository url incorrectly the first time. I tried earlier to remove all traces, but I wasn't thorough enough. – Dean Mar 6 '13 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .