1

I'd like to update the path of a submodule on a local branch and then push those changes. How do I accomplish this?

hrazzer
  • 79
  • 8

1 Answers1

0

Git 2.25+ (Q1 2020)

See "Git submodule url changed" and the new command

git submodule set-url [--] <path> <newurl>

Git 2.24 and before

You need to change the config of the .gitmodules file:

git config --file=.gitmodules submodule."SubmoduleName".path new/Root/Folder

Then re-sync:

git submodule sync
git submodule update --init --recursive --remote

Finally, add, commit and push (from the parent repo)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250