gpt4 book ai didi

Mercurial 在另一个分支中移动提交

转载 作者:行者123 更新时间:2023-12-03 06:02:05 26 4
gpt4 key购买 nike

我的同事不小心在默认分支中进行了两次提交,而不是创建新的他自己的开发分支。

如何改变这种情况并将这两个提交移至新分支?

最佳答案

想象一下以下场景:

D
|
C
| "I want to move C and D here"
B/
|
A

步骤:

  1. hg更新B
  2. hg 分支“mybranch”
  3. hg commit --message“创建我的分支”
  4. hg 更新 mybranch
  5. hgraft -r C
  6. hgraft -r D
  7. hg strip -r C(这应该是 C 最初的修订版本)

    strip 命令由您需要启用的扩展提供。您可以follow a guide on how to enable it on the Mercurial Wiki .

  8. hg 更新默认值

关于Mercurial 在另一个分支中移动提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6507480/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com