I'm learning to use Mercurial, and its learning curve is pretty straightforward. But one of my problem is, I can't add the .hgignore file to Mercurial folder. Windows (7) does not allow me to do this, and when I run the command
hg add .hgignore
, it returns error:
the system cannot find the specified file.
How can I create/add this file?
Execute
touch .hgignore
or
echo "" > .hgignore
in the needed directory
You don't need to add it to Mercurial directory. You should place
.hgignore
to repository's root directory.You also can set up global .hgignore files:
And there you can see instructions to define ignore file in mercurial.ini (or hgrc) file:
Create it from the command line