[英]How to properly commit a git repo with repos in subdirectories?
I have cloned few github repositories under one directory. 我已经在一个目录下克隆了几个github仓库。 Now I would like to make a repository one level above all of those repositories.
现在,我想使存储库比所有这些存储库高一级。
How can I do this properly ? 如何正确执行此操作? Should I use submodules ?
我应该使用子模块吗?
Short answer: yes, you should use submodules because you've identified that these pieces should evolve separately. 简短的回答:是的,您应该使用子模块,因为您已经确定这些部分应该分开发展。
Probably the easiest way to get it all in place is to create an empty folder, copy the "one directory up" content (anything not in the submodules) into it, commit, then pull in the submodules. 可能最简单的方法是创建一个空文件夹,将“一个目录向上”的内容(任何不在子模块中的内容)复制到其中,提交,然后拉入子模块。 This is because it's really easy to accidentally commit the submodule's code rather than referencing the submodule.
这是因为意外提交子模块的代码而不是引用子模块真的很容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.