更改git子模块的远程存储库
我创建了一个包含子模块的git存储库。 我能够告诉子模块本身更改其远程存储库路径,但我不知道如何告诉父存储库如何更改子模块的远程存储库路径。
我不会感到惊讶,如果我有点运气不好,不得不手动去做,甚至删除子模块也不容易。
您应该只需编辑.gitmodules
文件即可更新URL,然后运行git submodule sync
将该更改反映到超级项目和工作副本中。
这些命令将在不改变本地存储库上的任何文件的情况下执行命令提示符下的工作
git config --file=.gitmodules submodule.Submod.url https://github.com/username/ABC.git
git config --file=.gitmodules submodule.Submod.branch Development
git submodule sync
git submodule update --init --recursive --remote
请查看博客的截图:将GIT子模块URL / Branch更改为同一存储库的其他URL /分支
什么对我有用(在Windows上,使用git版本1.8.3.msysgit.0):
git submodule init
和git submodule update
做完这一切后,一切都处于我期望的状态。 我想,存储库的其他用户在更新时会有类似的痛苦 - 在你的提交消息中解释这些步骤是明智的!
链接地址: http://www.djcxy.com/p/16425.html