Git-如何更改子模块的url /路径

问题描述 投票:0回答:1

这是我的.gitmodules

[submodule "app/code/Fooman/GoogleAnalyticsPlus"]
        path = app/code/Fooman/GoogleAnalyticsPlus
        url = https://[email protected]/some_user/fooman_googleanalyticsplus.git

我需要将网址更改为https://github.com/Ethan3600/magento2-CronjobManager.git

所以我只是更改了它:

[submodule "app/code/Fooman/GoogleAnalyticsPlus"]
        path = app/code/Fooman/GoogleAnalyticsPlus
        url = https://github.com/Ethan3600/magento2-CronjobManager.git

然后我将文件添加到暂存区并进行提交:

git add .gitmodules
git commit -m "change url of submodule xy"

然后我执行了git submodule update --init。但是,如果我转到app/code/Fooman/GoogleAnalyticsPlus并显示遥控器,那么我仍然会收到https://[email protected]/some_user/fooman_googleanalyticsplus.git

git git-submodules
1个回答
0
投票

更新URL后,您需要删除并重新同步子模块。

请参阅此答案。https://stackoverflow.com/a/14405542/1895270

© www.soinside.com 2019 - 2024. All rights reserved.