需要一个子目录而不是一个子模块

需要一个子目录而不是一个子模块

问题描述:

我有一个班级要做的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.