The user could have configured the submodule to have a different URL from the one in the superproject's config. To account for this read what the submodule has configured for remote.origin.url and use that instead. Signed-off-by: Brandon Williams <bmwill@xxxxxxxxxx> --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index f8adfb179..02b85dceb 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -466,7 +466,7 @@ Submodule work tree '\$displaypath' contains a .git directory then # Remove the whole section so we have a clean state when # the user later decides to init this submodule again - url=$(git config submodule."$name".url) + url=$(GIT_DIR="$(git rev-parse --git-path modules/$name)" git config remote.origin.url) git config --remove-section submodule."$name" 2>/dev/null && say "$(eval_gettext "Submodule '\$name' (\$url) unregistered for path '\$displaypath'")" fi -- 2.11.0.483.g087da7b7c-goog