Mercurial 中等同于 git checkout –patch(又称 -p)的命令是什么?

huangapple go评论56阅读模式
英文:

What is the Mercurial equivalent of git checkout --patch (aka -p)?

问题

Mercurial 中是否有类似的命令?

英文:

The Git command git checkout --patch <commit> allows you to interactively apply hunks from the diff between HEAD and <commit> to your worktree. In other words it allows you to prepare a commit that partially updates your repo to match a different commit.

Is there an equivalent in Mercurial?

答案1

得分: 2

One way to do this (and commit the changes) is:

hg恢复 -r <commit> --all
hg提交 --interactive
# 在交互式界面中取消选择除了您想要保留的内容之外的所有内容
hg恢复 --all
英文:

One way to do this (and commit the changes) is:

hg revert -r &lt;commit&gt; --all
hg commit --interactive
# Deselect everything except what you want to keep in the interactive UI
hg revert --all

huangapple
  • 本文由 发表于 2023年5月18日 01:58:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76274967.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定