git 分支相对于标准源提交的优势

发布于 2024-12-27 09:19:04 字数 363 浏览 0 评论 0原文

在我看来,如果人们不信任他们的开发人员,即在大规模开源工作流程中,Git 似乎非常强大。

但是,我想知道在一个组织良好的项目中,Git 最有效的使用方式是什么,其中“n”个开发人员在“n”个独立的源代码包中进行开发,并就通用改进进行有效的沟通(例如通过 IRC),并深思熟虑地提交...

似乎在这种情况下,重分支只是将样板添加到现有的源代码树中。

因此,我提出一个问题:在后一种情况下,Git 的分支机制的优势是什么?

如果这表明我对 Git 的无知,请原谅我 - 这个问题的动机是,通常,当我分支时,我似乎并没有从中获得太多好处 - 但我确实倾向于忘记我所在的分支有时,这使得与 HEAD 同步代码有些困难。

It seems to me as though Git is very powerful if one does not trust their developers, i.e. in massively open-source workflows.

However, I wonder what the most effecient use of Git is in a well organized project, where "n" developers are developing in "n" separate source packages, communicating effectively (i.e. via IRC, for example) about generic improvements, and commiting thoughtfully...

It seems that in this scenario, heavy branching simply adds boiler plate to an existing source tree.

Thus, I pose the question of what the advantages of Git's branching mechanisms are, in the latter scenario?

Forgive me if this indicates my ignorance regarding Git — the motivation for this question is that, generally, when I branch, I don't seem to reap much benefit out of it — but I do tend to forget what branch Im in at times, and this makes syncing code with HEAD somewhat difficult.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

幸福不弃 2025-01-03 09:19:04

我不明白分支机构与信任有何关系。这不是它们的主要目的:它们是用于将更改和工作流程组织到存储库中的工具。此外,Git 中的分支可以放大或缩小:它可以在大型开源项目中工作,也可以在更小、更受控制的环境中工作。

我想说的是,分支的优点(一般来说)是它们可以让你很好地组织你的工作。你可以有一个可以单独审查的功能分支,你可以有一个用于下一个版本的稳定分支,等等。

I don't see how branches relate to trust. That's not their primary purpose: they are a tool for organizing changes and the flow of work into a repository. Also, branching in Git can be scaled up and down: it can work in big open source projects, and in smaller, more controlled environments.

I'll say that the advantage of branches (in general) is that they allow you to organize your work well. You can have a feature branch that can be reviewed separately, you can have a stabilization branch for the next release, etc.

你好,陌生人 2025-01-03 09:19:04

分支的概念主要用于允许存在多个并行开发版本,并且不一定允许多个开发人员处理代码。事实上,即使在只有一名开发人员的项目上,分支也是有意义的(假设您维护着一条工作不太稳定的开发线,而 v.1.0 是稳定的并且只接受错误修复)。

The concept of branching is primarily used to allow multiple parallel versions of development to exists, and is not necessarily there to allow more than one developer to work on the code. As a matter of fact, branching makes sense even on a project with only one developer (say you maintain a working not-so-stable line of development, and v.1.0 which is stable and accepts only bugfixes).

一直在等你来 2025-01-03 09:19:04

在后一种情况下,git 的分支机制有什么优势?

“错误的人性是这样的”。每个分支的功能可以保护每个开发人员免受自己的错误和所有团队的影响 - 避免使用未完成或半损坏的功能。

what the advantages of git's branching mechanisms are, in the latter scenario ?

"Errare humanum est". Feature-per-branch protect every developer from own errors and all team - from using unfinished or semi-broken features.

情未る 2025-01-03 09:19:04

我们在此工作流程中使用 gitolite。它允许非常严格的工作方式:

https://plus.google.com/109096274754593704906/posts/ R4qkeyRadLR

We use gitolite with this workflow. It allows a very disciplined way to work:

https://plus.google.com/109096274754593704906/posts/R4qkeyRadLR

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文