Mercurial - 是否可以在同一个存储库中将主干的更改合并到分支?

发布于 2024-09-06 11:41:25 字数 71 浏览 2 评论 0原文

Mercurial - 是否可以在同一存储库中将主干的更改合并到分支?

如果可以,TortoiseHg 可以吗?

Mercurial - Is it possible to merge changes from the trunk to a branch, within the same repository?

If yes, is it possible with TortoiseHg?

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

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

发布评论

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

评论(2

栀梦 2024-09-13 11:41:25

您可以做两件事:合并或移植。这些答案假设是命令行,您可能必须在乌龟中搜索菜单才能找到类似的功能。

您可以将一个分支的所有更改合并到另一个分支。其过程是:

hg update mybranch
hg merge default
hg commit -m "Merging with default"

这会将默认的所有提交带入您的分支,但反之则不然。稍后,您可以通过执行相反的操作来重新集成默认分支。

hg update default
hg merge mybranch
hg commit -m "Bringing in changes from mybranch"

如果您想引入在另一个分支中提交的一个或多个特定提交,您可以使用“移植”来实现,这是一个善变的扩展。

# reqiured in ~/.hgrc
[extensions]
transplant = 

这些是您可以用来使用移植的命令:

hg log | less
# (find revision number, the part after the colon, i.e. "88660cca467d")
hg update mybranch
hg transplant 88660cca467d
# (no commit required)

There are two things you can do, merge or transplant. These answers assume the command line, you may have to search through your menus in tortoise to find similar functionality.

You can merge all the changes from one branch to another. The procedure for this is:

hg update mybranch
hg merge default
hg commit -m "Merging with default"

This will bring all commits from default into your branch, but not the other way around. Later you can reintegrate your branch with default by doing the opposite

hg update default
hg merge mybranch
hg commit -m "Bringing in changes from mybranch"

If you want to bring in one or more specific commits that were committed in another branch, you can do that with 'transplant', which is a mercurial extension.

# reqiured in ~/.hgrc
[extensions]
transplant = 

These are the commands you can use to use transplant:

hg log | less
# (find revision number, the part after the colon, i.e. "88660cca467d")
hg update mybranch
hg transplant 88660cca467d
# (no commit required)
身边 2024-09-13 11:41:25

正如@Jerub 所说,您可以使用合并和移植将更改集从一个分支获取到另一个分支。使用 TortoiseHg,您可以通过打开“存储库资源管理器”进行合并,然后选择要合并的第一个修订版本,然后右键单击要合并的第二个修订版本。选择“合并...”菜单项进行合并。

As @Jerub said, you can use merge and transplant to get change sets from one branch to another. With TortoiseHg you can do a merge by opening the "repository explorer", then select the first revision to merge, and afterwards right click on the second revision to merge. Chose the "Merge with..." menu item to do the merge.

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