私有分支的版本控制?

发布于 2024-08-02 03:25:55 字数 161 浏览 4 评论 0原文

虽然我知道您可以使用第二个存储库进行备份,或者创建一个名为“privateBranchOfXcompletelyBrokenBackupOnly”的分支,但我有兴趣了解本地支持远程私有分支的版本控制系统。

编辑:忘记告诉它应该是远程私有的。 似乎只有镜像推送到私人仓库才会模仿这一点。

While I know you can use a second repository for backup, or create a branch named 'privateBranchOfXcompletelyBrokenBackupOnly', I'm interested to hear about a version control system that supports remote private branches natively.

edit: forgot to tell that it should be remote private. Seems only mirror-pushing to a private repo mimicks this.

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

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

发布评论

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

评论(4

沩ん囻菔务 2024-08-09 03:25:55

新一代 DVCS(例如我使用的 Git)的一大优点是,单个开发人员可以很好地控制他们选择的工作方式。 使用 Git,我可以创建自己的私有分支,这些分支对我来说意味着特定的事情,但不一定对其他人有意义,并且可以在本地与它们一起工作,而其他人甚至不需要知道它们的存在。 我可以在这些分支之间移动更改,对提交进行排序和组织,并且仅在准备好共享更改时将更改推送到上游。

对于 CVS 甚至 Subversion 等集中式系统,创建分支是一项全世界可见的重量级操作,它实际上会更改共享存储库。 您必须勤于命名分支(这样各个开发人员就不会发生冲突),并在完成后手动清理。

如上所述,Git 还可以轻松支持公共分支,我可以在其中创建一个分支,做一些工作,然后将其推送到上游,以便其他人可以与我在该分支上进行协作。 或者,我可以创建一个分支,同事可以直接从我这里拉取它,而不必与所有人共享。

网站 Why Git is Better Than X 提供了有关此功能的更多信息。 事实上,第一项的标题是“廉价本地分支”。

One of the great things about the new generation of DVCS (such as Git, which I use) is that an individual developer has great control over how they choose to work. Using Git, I can create my own private branches that mean specific things to me but not necessarily anybody else, and work with them locally without anybody else even needing to be aware of their existence. I can move changes between those branches, sort and organise commits, and only push my changes upstream when I'm ready to share them.

With a centralised system such as CVS or even Subversion, creating a branch is a world-visible, heavyweight operation that actually changes the shared repository. You have to be diligent in naming your branches (so individual developers don't collide) and manually clean things up when you're done.

Having said the above, Git also supports public branches easily, where I can create a branch, do some work, and push it upstream so that others can collaborate on that branch with me. Or, I can create a branch and a coworker can pull it from me directly without having to share it with everybody.

The site Why Git is Better Than X has more information about this feature. In fact, the first item is titled "Cheap Local Branching".

时光倒影 2024-08-09 03:25:55

Git 在本地处理私有分支方面做得很好。 每个开发人员都有自己的分支,他们可以随意使用,然后当他们准备好与其他开发人员共享他们的更改时,他们只需将更改合并回主分支即可。

它当然并不适合每个人或每个项目,但在许多情况下这种方法有一些很大的好处。

Git does a great job of handling private branches natively. Each developer gets their own branch that they can do with as the please, then when they are ready to share their changes with the other developers, they just merge their changes back into the main branch.

It's certainly not perfect for everyone or for every project, but in many cases this approach has some great benefits.

花桑 2024-08-09 03:25:55

任何 DVCS,例如 Bazaar、Mercurial、Darcs 或 Git,都支持私有分支。

Any DVCS, such as Bazaar, Mercurial, Darcs, or Git, supports private branches.

是伱的 2024-08-09 03:25:55

正如所说,任何 DVCS 都应该这样做,但如果您也希望它们是“本地”的 - 就像您在同一目录中的分支之间切换一样(我发现这是无价的),您绝对应该更喜欢这里的 git。 Hg 对这个“本地”分支有某种支持,但是一旦您使用了它们,您就可以清楚地看到差异,并且它不会使 hg 看起来有任何好处。
工作流程再简单不过了:
1. 'git克隆git://some_server/some_repo'
2. 'git checkout -b your_branch_name'
3.“做一些工作
4.“git checkout master”(或其他一些分支名称,如果您不使用 master)
5. 'git rebase your_branch_name'
6.“git push”或其他“git”-发布您的作品的方式。
最好的事情 - 一切都发生在一个目录中,不再有类似这样的东西:checkout.000 checkout.001 checkout.002 :)

As said any DVCS should do, but if you'd like them "local" as well - like you switch between branches in the same directory (which I found invaluable) you should most definitely prefer git here. Hg has some sort of support for this "local" branches, but once you've used them both you can clearly see the difference, and it doesn't make hg look any good.
Workflow couldn't be simpler:
1. 'git clone git://some_server/some_repo'
2. 'git checkout -b your_branch_name'
3. 'do some work'
4. 'git checkout master' (or some other branch name, if you're not using master)
5. 'git rebase your_branch_name'
6. 'git push' or some other "git"-means of publishing your work.
And the best thing - everything happens in one directory, no more stuff like: checkout.000 checkout.001 checkout.002 :)

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