使用 Mercurial 推动多个头

发布于 2024-11-01 16:18:42 字数 754 浏览 3 评论 0原文

对于这样的工作流程,

$hg clone <bitbucket repo>
... fix, fix ...
$hg commit -m "good comment!"

$hg bookmark stable 
...new fix on stable...
$hg commit -m "new fix on stable bookmark"

$hg bookmark experimental --> I would like to defer merging until its stable.
... hack hack more hack ....
$hg commit -m "more hack on experimental"
$created new head

$hg push <bitbucket repo>
"abort: push creates new remote heads!"
(did you forget to merge? use push -f to force)

我读过很多文章“永远不要使用 push -f 来强制”。

但是,是的,实验头需要被推动,因为我不想合并直到它足够稳定。我也不想在我的计算机上将此书签上的更改保留太长时间(如果系统崩溃会发生什么?),我想拉出此书签并稍后继续实验。不过,它是一种“集中”方法。 处理这种情况的最佳方法是什么? 有没有办法使用书签来处理这个工作流程?不想使用命名分支。

注意:我刚刚使用了“push -f”,但 Bitbucket 从未在存储库“标签”链接上显示此书签。

For a workflow like this,

$hg clone <bitbucket repo>
... fix, fix ...
$hg commit -m "good comment!"

$hg bookmark stable 
...new fix on stable...
$hg commit -m "new fix on stable bookmark"

$hg bookmark experimental --> I would like to defer merging until its stable.
... hack hack more hack ....
$hg commit -m "more hack on experimental"
$created new head

$hg push <bitbucket repo>
"abort: push creates new remote heads!"
(did you forget to merge? use push -f to force)

I've read a lot saying 'NEVER EVER use push -f to force'.

But yes, the experimental head needs to be pushed, as I don't want to merge untill its stable enough. I don't want to keep the changes on this bookmark on my machine for too long either (what happens if system got crashed?) and I'd like pull this bookmark and continue experiments later. Its a kind of 'centralized' approach though.
Whats the best way to deal with kind of situation ?
Is there any way to use bookmarks to deal this workflow? Don't want to use named branch.

Note: I just used 'push -f', but Bitbucket never shows this bookmarks on repositories 'Tags' link.

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

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

发布评论

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

评论(1

吲‖鸣 2024-11-08 16:18:42

你所做的一切都很好。 “不要使用 push -f” 是给那些已经拉过、有多个头并且不知道这意味着什么的人的建议。

书签不会显示在 bitbucket 上。当然,变更集将显示为标题,但标记不会存储在存储库中。当两个版本 1.6 或更高版本的 Mercurial 的推/拉变更集时,它们会将书签传输到带外,但 bitbucket 尚不支持(据我所知)。

What you're doing is just fine. The "don't use push -f" is advice for people who have pulled, have multiple heads, and don't know what that means.

Bookmarks won't show up on bitbucket. The changesets will show up as heads, of course, but the boomarks aren't stored in the repo. When two version 1.6 or later Mercurial's push/pull changesets they transfer bookmarks out-of-band, but bitbucket doesn't have support for that yet (to my knowledge).

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