Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hg local ignore

I could have sworn there was a way to keep a local ignore file in an hg repo, i.e. a file similar in function to .hgignore, but not checked into the repo. This could be used to ignore changes to an IDE project file if different IDEs are being used, for example. I'm having trouble finding how it's done. Does anyone recall the details?

like image 292
fakeleft Avatar asked Jun 15 '09 14:06

fakeleft


People also ask

How do you ignore a file in Heartgold?

Use a local . hgignore which you do not commit, and add whatever you want to it, placing . hgignore first.

What is hgignore file?

The . hgignore file sits in the working directory, next to the . hg folder. It is a file versioned as any other versioned file in the working directory, which is used to hold the content of the ignore patterns that are used for any command operating on the working directory.


3 Answers

This is what I was looking for.

Add the following to the repo's .hg/hgrc:

[ui]
ignore = /path/to/repo/.hg/hgignore

and create a new file .hg/hgignore beside it. This new file will be untracked, but work the same as the versioned .hgignore file for this specific working copy. (The /path/to/repo bit is unfortunate but necessary to make it work when invoking 'hg' from within a subdir of the repo.)

like image 62
fakeleft Avatar answered Sep 23 '22 20:09

fakeleft


In version 3.5, setting the ignore property under the ui section changes the global ignore file. To add additional files to be ignored, follow the advice of Jeroen Dierckx and set the ignore.local property to get the same effect as adding to .git/info/exclude in a git repository.

[ui]
ignore = .hgignore
ignore.local = .hg/hgignore
like image 21
Keith Prussing Avatar answered Sep 23 '22 20:09

Keith Prussing


Just make an .hgignore file and add .hgignore to the .hgignore file itself.

like image 20
John Weldon Avatar answered Sep 25 '22 20:09

John Weldon