Search code examples
version-controlmercurialcommitdvcs

Exclude file from a changeset?


Possible Duplicate:
Using mercurial, what's the easiest way to commit and push a single file while leaving other modifications alone?
Check in single file with Mercurial?

I made changes to 2 files. One has a bug fix, the other has a bunch of temporary debugging code that I want to keep in my working directory for now but do not want to commit.

With git I would only add the first file to the changeset, how do I easiest do this with mercurial?


Solution

  • Can you not simply commit the one file that you do want:

    hg commit filename
    

    Alternatively, you could use the -X option to exlude the other file:

    hg commit -X filename2
    

    Since you only have 2 files, one which should be commited and one which should not, it doesn't really make a difference either way.

    See the documentation for more information.