Check in single file with Mercurial?
Solution 1
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 :-)
Solution 2
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.
Solution 3
On the off chance you're running on Windows, TortoiseHG (a graphical Mercurial interface) lets you select which files to commit every time.
![Marcus Leon](https://i.stack.imgur.com/Xk75m.jpg?s=256&g=1)
Marcus Leon
Director Clearing Technology, Intercontinental Exchange. Develop the clearing systems that power ICE/NYSE's derivatives markets.
Updated on June 07, 2022Comments
-
Marcus Leon about 2 years
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 thenhg push
) just one of the modified files?