Let's say you do hg status
and you have three files modified. I know how to check in all three files (hg commit
). But how can you check in (and then hg push
) just one of the modified files?
views:
233answers:
4You're right it's been asked before but the prevailing answers on that one are pretty awful. MQ and Shelve make no sense if you just want to commit a single file.
Ry4an
2010-05-25 20:24:46
Agree with Ry4an, though the question is the same, those answers are no good.
dimo414
2010-05-27 23:34:29
+2
A:
Just do:
hg ci -I path/to/file -m "commited only one file"
That commits only one file, and you can push it, and none of the uncommitted changes will be affected.
Ry4an
2010-05-25 20:24:06
you should also be able to do it just like you would in svn: hg commit -m "here is my message" path/to/file
RyanWilcox
2010-05-25 23:28:15
+3
A:
Please check the output of hg help commit
which reveals that you can do
hg commit foo.c
if you just want to commit a single file. This is just like Subversion and many other systems -- no hocus-pocus :-)
Martin Geisler
2010-05-26 07:54:50
+1
A:
On the off chance you're running on Windows, TortoiseHG, the graphical Mercurial interface, lets you select which files to commit every time.
dimo414
2010-05-27 23:35:44