How do I move an existing Git submodule within a Git repository?

I would like to change the directory name of a Git submodule in my Git superproject.

Lets suppose I have the following entry in my .gitmodules file:

[submodule ".emacs.d/vimpulse"]  
path = .emacs.d/vimpulse  
url = git://gitorious.org/vimpulse/vimpulse.git

What do I have to type to move the .emacs.d/vimpulse directory to .emacs.d/vendor/vimpulse without deleting it first (explained
here and here) and then re-adding it.

Does Git really need the whole path in the submodule tag

[submodule ".emacs.d/vimpulse"]

or is it also possible to store just the name of the subproject?

[submodule "vimpulse"]

11 Answers
11

Leave a Comment