需要一个子目录而不是一个子模块 [英] Need a subdirectory not a submodule

查看:49
本文介绍了需要一个子目录而不是一个子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个班级要做的4个作业的git存储库.然后,我想将所有这些分配移动到一个存储库中,以便为我的git上的更多私有存储库腾出空间(我们只允许这么多).当我尝试通过仅将文件移动到新目录并使用git add来执行此操作时.相反,这使子模块,那不是我想要的.如何将这些代码文件夹添加为子目录而不是子模块?

I had a git repository of 4 Assignments that I had to do for a class. I then wanted to move all those assignments into one repository to make room for more private repositories on my git (We are only allowed so many). When I tried to do it by just moving the files into the new directory and using git add. This instead made submodules and that isn't what i want. How can add these folders of code as a subdirectory and not a submodule?

推荐答案

如果您只想要没有开发历史记录的文件,则可以简单地将每个原始存储库复制到新存储库中,然后删除目录中的.git文件夹.复制并粘贴存储库.

If you just want the files without the development history, you can simply copy each of the original repositories to the new one, deleting the .git folder in the copy-and-pasted repositories.

如果要保留开发历史记录,请遵循

If you want to preserve the development history, follow the instructions in this post.

这篇关于需要一个子目录而不是一个子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆