我怎样才能重命名与子模块的Git存储库? [英] How can I rename a git repository with submodules?
问题描述
我在目录 projects / myRepo
中有一个包含子模块的git存储库,我想将目录重命名为 projects / my-repo
。
根据这个问题可以简单地用 fatal:不是git仓库:projects / myRepo / .git / path / to / submodule``` 即使对于 子模块配置: 子模块的内部路径不会更新?!有没有办法告诉git更新这些子模块路径? 由于韦斯顿的测试(在克隆的repo中的子模块的克隆,初始化和更新)在重命名包含所述子模块的目录时按预期工作,我怀疑子模块 I have a git repository with submodules in the directory According to this question it can simply be done with fatal: Not a git repository: projects/myRepo/.git/path/to/submodule``` even for Submodule config: Somehow the 'internal path' for the submodule does not get updated?! Is there a way to tell git to update these submodule paths? Since Weston's test (clone, init and update of a submodule in a cloned repo) worked as expected when renaming the directory including said submodule, I suspect something must have been wrong in the submodule You could compare/look for any file referencing ' 这篇关于我怎样才能重命名与子模块的Git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! mv
来完成。但是在一个有子模块的仓库中,git总是告诉我:
lockquote>
git status
。
[submodulepath / to / submodule]
path = path / to / submodule
url = https://github.com/user/projectName.git
.git $你可以比较/寻找任何引用'
myRepo
的文件。
您还可以比较两个子模块的内容(第一个是您尝试重命名的内容,第二个是您克隆的回购库中的第二个)projects/myRepo
and I want to rename the directory to projects/my-repo
.mv
. But in a repo with submodules git keeps telling me
git status
.[submodule "path/to/submodule"]
path = path/to/submodule
url = https://github.com/user/projectName.git
.git
itself in your original Git repo submodule.myRepo
' in that first submodule.
you can also compare the content of the two submodules (the first one you tried to rename, and the second one included in the repo that you cloned)