hg相当于git add -p? [英] hg equivalent of git add -p?

查看:154
本文介绍了hg相当于git add -p?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个相当于的git add -p



从man引用git-add with选项-p(或--patch)执行以下操作:


在索引和工作$ b $之间交互选择补丁块b树并将它们添加到索引。这给了用户一个机会
在将修改后的内容添加到索引之前审查差异。


解决方案

div>

查看记录扩展名(它与Mercurial捆绑在一起) 。

请注意,由于Mercurial没有像git这样的暂存区域概念,因此运行 hg record 将会只需允许您检查工作副本中的修改即可。您选择进行记录的任何更改都会被提交,并且您选择 not 进行记录的任何更改都只会作为工作副本中的修改。


Is there a mercurial equivalent of git add -p?

Quoting from man, git-add with the option -p (or --patch) does the following:

Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.

解决方案

Have a look at the record extension (which comes bundled with Mercurial).

Note that since Mercurial doesn't have the concept of the staging area like git, running hg record will simply allow you to examine, hunk by hunk, the modifications in your working copy. Any changes you choose to record will be committed, and any changes you choose not to record are simply left as modifications in your working copy.

这篇关于hg相当于git add -p?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆