I'd like to update the path of a submodule on a local branch and then push those changes. How do I accomplish this?
Asked
Active
Viewed 48 times
1 Answers
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,129,465
- 480
- 4,036
- 4,755