Github和将存储库类型分开放置在不同文件夹中

huangapple go评论82阅读模式
英文:

Github and separating type of repositories into different folders

问题

阅读了一些关于此问题的问题和一些网上的讨论,比如https://stackoverflow.com/questions/11852982/can-i-arrange-repositories-into-folders-on-github,我仍然不知道如何使其工作。目前,我将“文件夹名称”添加到项目前面,但这当然是不好的做法。

在我的GitHub存储库中,我想将不同类型的项目分开放置在它们自己的文件夹中。
例如,在“文档”文件夹中有文档项目和存储库,各种软件包在它们自己的文件夹中,代码片段在代码片段文件夹中;当然,如果我们可以谈论文件夹的话。

我该如何实现这一点;远程路径应该是什么样的?

对此有什么建议吗?
我知道例如如何在一个存储库中添加多个代码片段,方法是在父文件夹中使用git init,但现在要创建或将其移动到一个父“文件夹”中。

如果有的话,欢迎提供脚本。

提前感谢您。

英文:

Reading several questions and some discussion on the web, like https://stackoverflow.com/questions/11852982/can-i-arrange-repositories-into-folders-on-github, I still don’t know how to get this working. For the moment I add the “folder name’ in front of the project, but is of course bad practice.

In my github Repository I would to separate the different kind of projects into their own folder.
F.e Documentation projects and Repositories in the Documents folder, Packages in their folder, Gists in the Gist folder; of course if we can talk about folders.

How can I accomplish that; what should the remote path look like?

Any suggestions about this?
I know f.e how to add several Gists in one repository by using git init in the parent folder but now to create or move it to a parent ‘folder’.

A script is also welcome if that exists.

Thank you in advance.

答案1

得分: 1

I would use submodules.

Step 1:
Create those projects as separate repositories: Documentation, Packages, Gists.

Step 2:
Create a main repository, and add the repositories created on Step 1 into the main repository as a submodule.

That way you have everything separated into their own folders with their own history of commits and branches. Keep adding/committing to them as separated repos, but you can see them all in one place as folders in the main repository.

英文:

I would use submodules.

Step 1:
Create those projects as separate repositories: Documentation, Packages, Gists.

Step 2:
Create a main repository, and add the repositories created on Step 1 into main repository as a submodule.

That way you have everything separated into their own folders with their own history of commits and branches. Keep adding/committing to them as separated repos, but you can see them all in one place as folders in the main repository.

huangapple
  • 本文由 发表于 2023年7月31日 22:47:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76804755.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定