Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Version control 在Mercurial中仅提交一些文件_Version Control_Mercurial - Fatal编程技术网

Version control 在Mercurial中仅提交一些文件

Version control 在Mercurial中仅提交一些文件,version-control,mercurial,Version Control,Mercurial,很多时候,我对存储库中的文件进行两次不同的更改,我希望这些更改被视为两次连续提交 例如,在存储库中 程序c 程序h 自述文件 在修复bugprog.c和prog.h时,我修复了README.txt中的一个打字错误。现在我想用自己的提交消息将更改提交到prog.c,然后再提交到README.txt 在git中,我可以通过索引轻松地实现这一点 git add prog.c prog.h git commit -m 'bug #1234' git commit README.txt -m 'som

很多时候,我对存储库中的文件进行两次不同的更改,我希望这些更改被视为两次连续提交

例如,在存储库中

  • 程序c
  • 程序h
  • 自述文件
在修复bug
prog.c
prog.h
时,我修复了
README.txt
中的一个打字错误。现在我想用自己的提交消息将更改提交到
prog.c
,然后再提交到
README.txt

在git中,我可以通过索引轻松地实现这一点

git add prog.c prog.h
git commit -m 'bug #1234'
git commit README.txt -m 'some typos fixed'
在Mercurial中,最好的方法是什么

澄清:在编辑之前,我使用了一个玩具示例,其中每个变更集跨越一个文件。但是我想要一个一般的答案,当每个变更集中有很多文件时,我应该怎么做

hg commit -m "bug #1234" prog.c prog.h
然后


为此,我喜欢crecord mercurial扩展名:它让我一个文件一个文件(一块一块,一行一行)地控制我在提交中到底想要什么。

如果bug#1234?hg commit-m“bug#1234”prog.c prog.hIf你想要除了README.txt以外的所有文件:hg commit-m“bug#1234”-X README.txt有关所有参数的列表:hg help-v commitOr mercurial附带并在Windows上运行的原始记录扩展。这是否回答了您的问题?
hg commit -m "some typos fixed" README.txt