Submodules:
*Moving a submodule
Run:
$ git mv old/path/to/module new/path/to/module
.gitmodules and change the path of the submodule appropriately, and put it in the index with git add .gitmodules.
.. then directories in the direct path in that place. . Edit the file new/path/to/module/.git, make sure that the path in it points to the correct new location inside the main project .git folder, so in this example gitdir: ../../../.git/modules/new/path/to/module.
git status output looks like this afterwards:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: .gitmodules
# renamed: old/path/to/submodule -> new/path/to/submodule
#
This example from Stack Overflow, by Axel Beckert