问题描述
我已经将一个存储库克隆到PatchBasedInpaintingDevelop。我一直在那里工作一段时间没有问题。然后我决定在本地重命名文件夹。
doriad @ daviddesktop:/ media / portable /我的目标是使用'mv PatchBasedInpaintingDevelop PatchBasedInpainting',现在git status抱怨子模块, Projects / PatchBasedInpainting $ git status
fatal:不是git存储库:/media/portable/Projects/PatchBasedInpaintingDevelop/.git/modules/ITKQtHelpers
有没有办法在不打破子模块结构的情况下做这个动作?
看来你的 )
submodule。< name> .path
定义相对于git工作树的顶级目录的路径,该子模块应该在该路径中签出。
路径名不得以 /
。
所有子模块路径在 .gitmodules
文件中必须是唯一的。
唯一的解决方法是修复所有绝对路径(如)
I had cloned a repository to PatchBasedInpaintingDevelop. I've been working in there for a while with no problems. Then I decided to rename the folder locally. I did 'mv PatchBasedInpaintingDevelop PatchBasedInpainting' and now git status complains about submodules, saying:
doriad@daviddesktop:/media/portable/Projects/PatchBasedInpainting$ git status
fatal: Not a git repository: /media/portable/Projects/PatchBasedInpaintingDevelop/.git/modules/ITKQtHelpers
Is there a way to do this move without breaking the submodule structure?
It seems your .gitmodules
file reference the submodules using an absolute path.
Try using a relative path for said submodules.
(as shown, for instance, in "Managing a set of related repositories relative in Git")
submodule.<name>.path
Defines the path, relative to the top-level directory of the git working tree, where the submodule is expected to be checked out.
The path name must not end with a /
.
All submodule paths must be unique within the .gitmodules
file.
The only other solution is to fix all the absolute paths (as in this script)
这篇关于移动包含子模块的git存储库的父目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!