Is there some easy way to rename a git submodule directory (other than going through the entire motion of deleting it and re-adding it with a new destination name).
<
It's not possible to rename it, so you've to remove it first (deinit
) and add it again.
So after removing it:
git submodule deinit
git rm --cached
you may also double check and remove the references to it in:
.gitmodules
.git/config
.git/modules/
(best to make a backup), as each folder has config
file where it keeps the reference to its worktree
then stage your changes by committing any changes to your repo by:
git commit -am 'Removing submodule.'
and double check if you don't have any outstanding issues by:
git submodule update
git submodule sync
git submodule status
so now you can add the git submodule again:
git submodule add --name git@github.com:foo/bar.git