Skip to content

Instantly share code, notes, and snippets.

@simonLeary42
Last active August 5, 2026 13:29
Show Gist options
  • Select an option

  • Save simonLeary42/2a07105776eb7f2c836a9c8c958ba8e4 to your computer and use it in GitHub Desktop.

Select an option

Save simonLeary42/2a07105776eb7f2c836a9c8c958ba8e4 to your computer and use it in GitHub Desktop.
how to move a git submodule
  • edit .gitmodules > [submodule "path/to/submodule"]
  • edit .git/config > [submodule "path/to/submodule"]
  • edit path/to/submodule/.git > gitdir
  • edit .git/modules/path/to/submodule/config > worktree
  • move .git/modules/path/to/submodule to its new path
@simonLeary42

simonLeary42 commented Jul 27, 2026

Copy link
Copy Markdown
Author

note: if you just want to change the submodule URL, you can git config --global url.insert_url_here.insteadOf

https://stackoverflow.com/questions/55241341/changing-https-address-of-submodules-in-git-config-to-ssh-address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment