Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check in single file with Mercurial?

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?

like image 901
Marcus Leon Avatar asked May 25 '10 20:05

Marcus Leon


People also ask

How do I revert a file in Mercurial?

To revert a file to a specific changeset, use hg revert -r CHANGESET FILENAME . This will revert the file without committing it.

How do you Untrack a file in Heartgold?

If you see the help for hg rm --help : hg remove [OPTION]... FILE... Schedule the indicated files for removal from the current branch. This command schedules the files to be removed at the next commit.


2 Answers

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 :-)

like image 181
Martin Geisler Avatar answered Oct 04 '22 21:10

Martin Geisler


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.

like image 24
Ry4an Brase Avatar answered Oct 04 '22 20:10

Ry4an Brase