你如何组织你的 git 存储库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/489988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:34:09  来源:igfitidea点击:

How do you organize your git repositories?

gitversion-controldvcsrepository

提问by officemonkey

"Traditional" version control systems follow a "Cathedral" model -- all the code is stored in one main repository.

“传统”版本控制系统遵循“大教堂”模型——所有代码都存储在一个主存储库中。

Distributed Version Control Systems like git allow a lot more flexibility in organizing your multiple repositories. You can "push" changes, "pull" changes, and "clone" repositories.

像 git 这样的分布式版本控制系统在组织多个存储库时提供了更大的灵活性。您可以“推送”更改、“拉取”更改和“克隆”存储库。

Have you organized your repositories along your workgroup or workflow lines? Have you noticed any patterns?

您是否按照工作组或工作流线组织了存储库?你注意到任何模式了吗?

回答by Abie

Scott Chacon, whose git-fu is very strong, has some great slides on this in Getting Git. Check pages 474-501 for many excellent diagrams explaining three types of workflow:

Scott Chacon 的 git-fu 非常强大,在Getting Git 中有一些很棒的幻灯片。查看第 474-501 页的许多优秀图表,解释了三种类型的工作流程:

  • central repository model (svn style),
  • dictator and lieutenants model (linux kernel style),
  • integration manager model (github style).
  • 中央存储库模型(svn 风格),
  • 独裁者和中尉模型(Linux内核风格),
  • 集成管理器模型(github 风格)。

The full context for the referenced slides can be found here Pro Git - 5.1 Distributed Git - Distributed Workflows.

可在此处Pro Git-5.1 Distributed Git-Distributed Workflows 中找到参考幻灯片的完整上下文。

回答by TokenMacGuy

I'm still pretty new to git, but the way i've been handling this is making a total mess on my own repository, and when I get to a state that looks pretty healthy (at least a few unit tests pass), I tag it and push to a publicly accessible repository.

我对 git 还是很陌生,但是我处理这个问题的方式在我自己的存储库上弄得一团糟,当我达到一个看起来很健康的状态时(至少通过了一些单元测试),我标记它并推送到可公开访问的存储库。