如何在推送默认分支时阻止命名分支?

发布于 2024-09-29 10:16:55 字数 138 浏览 0 评论 0原文

假设我向名为“X”的新本地命名分支提交了一些更改。然后我向我的“默认”分支提交一些其他更改。我可以推送“default”上的更改集,但推送“X”上的更改吗?

我的方法可能是错误的吗?如果有,请大家批评指正。

Say I commit some changes to a new local named branch called 'X'. Then I commit some other changes to my 'default' branch. Can I push only the changesets on 'default', but not the changes on 'X'?

Might my approach be wrong? If so, please offer criticism.

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

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

发布评论

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

评论(1

小嗷兮 2024-10-06 10:16:55

差不多了。只需执行以下操作:

hg push -r default

当您将 -r X 选项与 pushpullclone 结合使用时。您的意思是“给我匹配 X 及其所有祖先的最新变更集。因此,如果您执行 hg Push -r default,您将在 上发送最新变更集 合并到 default 中的其他分支上的变更集将转到,但如果您将分支分开,您将只发送 default。

>default 及其所有祖先。因此, 使用 hg outgoing -r default 来查看您要推送的内容

这是一篇很好的文章,其中介绍了一种仅推送您正在处理的单个命令事务的分支的方法: http://hgtip.com/tips/advanced/2009-09-28-nudge -a-温柔的推/

Pretty much. Just do this:

hg push -r default

When you use the -r X option with push, pull, or clone. You're saying "Get me the newest changeset that matches X and all of its ancestors. So if you do hg push -r default you send the newest changeset on default and all of its ancestors. So changesets on other branches that were merged into default will go to, but if you've kept the branches separate you'll be sending only default.

Note that you can always test your push with hg outgoing -r default to see exactly what you'd push.

Here's a nice write up with a way to make pushing only the branch on which you're working a one command affair: http://hgtip.com/tips/advanced/2009-09-28-nudge-a-gentler-push/

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