Mercurial 中的小型临时分支

发布于 2024-09-03 02:23:09 字数 456 浏览 6 评论 0原文

我已经阅读了很多有关 Mercurial 及其分支的内容,但是,我仍然是一个版本控制新手。

我目前正在开发一个项目,我的任务是开发一个新模块。

我有一个“主”存储库,其中包含项目其余部分的最新代码,以及一个克隆存储库(称为“任务”),我现在正在其中进行工作。

我对我的任务进行了一系列的提交,并发现我想用我的程序读取/存储/处理配置数据的方式做一些“实验”。

现在,如果我正确理解了 VC 最佳实践,这将是一个分支的好时机。

如果我开始这个实验,并且我喜欢它的发展方向,我会想很快地将它合并回“默认”分支上的“任务”存储库。

另一方面,如果我不喜欢它的进展,我可能会废弃该分支。

我最舒服的分支方式是通过克隆,但是我不认为这在这种情况下是最好的方法,因为我只会更改几个文件,但显然使用命名分支是永久性的,这并不在这里似乎也合适。

对于这种情况,您的建议/最佳实践是什么?

I've read a lot about Mercurial and branching in it, however, I am still very much a version control newbie.

I'm currently working on a project, where I have been tasked to work on a new module.

I have a "main" repository, which contains the latest code from the rest of the project, and a cloned repository (call it "task") where I am doing my work now.

I am a bunch of commits into my task, and find that I would like to do a little "experiment" with the way my program reads/stores/handles configuration data.

Now, if I understand VC best-practices correctly, this would be a great time to branch.

If I start into this experiment, and I like where it's going, I will want to merge it back into my "task" repository on the "default" branch pretty quickly.

On the other hand, if I don't like how it's going, I'll probably just scrap the branch.

The way I am most comfortable branching is through cloning, however I don't think this would be the best approach in this situation, as I'll only be changing a few files, but apparently using named branches is permanent, which doesn't seem appropriate here either.

What is your advice / best practice for this kind of situation?

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

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

发布评论

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

评论(2

眼眸里的快感 2024-09-10 02:23:09

我对 Mercurial 比较陌生,但我确切地知道您所描述的情况。我之前对此做了一些研究,我的结论是最简单的方法是克隆我的存储库。

请参阅此答案了解更多信息。

另外,这是一个很棒的 Mercurial 分支指南:)

I'm relatively new to Mercurial, but I know exactly the situation you are describing. I did some research on this before, and my conclusion was that the easiest way was to clone my repository.

See this answer for some more insight.

Also, this is a great guide to branching in Mercurial :)

魂归处 2024-09-10 02:23:09

毫无疑问,选择克隆。 Mercurial 中的命名分支甚至连 Mercurial 人员也说您并不经常需要。 DVCS 的优点之一是,您可以轻松克隆存储库并尝试一些新的和不同的东西,如果它们有效,那就太好了,将其合并回主存储库,否则,将其全部删除。

我个人在 Mercurial 中使用“按功能分支”方法,这意味着我将为我正在开发的每个功能创建我的主要存储库的克隆。这包括尖峰和实验。

Go with a clone, no doubt about it. A named branch in Mercurial is something that even the Mercurial folks say you don't need all that often. One of the beautiful things about DVCS is the fact that you can easily clone the repo and try some new and different things, and if they work, great, merge it back in to the main repo, otherwise, delete it all.

I personally use a "Branch By Feature" approach with Mercurial, which means that I will make a clone of my primary repo for each feature I'm working on. This includes spikes and experiments.

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