Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override the global ignore?

In my global .hgignore file, I'm ignoring files in the packages/ directory. In this one repo, I want to not ignore that folder.

Is it possible to un ignore a file that has been ignored by a previous .hgignore?

like image 577
moswald Avatar asked Sep 08 '14 21:09

moswald


People also ask

Can you override git ignore?

Committing Ignored Files Tell Git to not ignore this file by prefixing the file name with a ! in . gitignore, i.e. !. env . This will override any global ignore files or ignore files in parent directories.

Is there a global git ignore?

You can set up a global . gitignore file that lists files that will be ignored on all Git projects. This is the preferred way of ignoring editor artifacts, toolchain log files, OS files, and other miscellaneous crap.

Where is global Gitignore located?

By default, the global gitignore path is ~/. config/git/ignore on Unix/macOS and %USERPROFILE%\git\ignore on Windows.


1 Answers

Assuming that you are using the technique for globally ignoring files described here, then you can override the global ignore locally via editing the repo's hgrc:

Add the following to the file at \.hg\hgrc

[ui]
ignore=.hgignore

This is the local override of the global set in your %userprofile%\Mercurial.ini (or other files in the config cascade and tells Mercurial to use the .hgignore file at the root of the repo.

Note that this method then uses none of the global ignore file, so the parts you want to use will need to be in the local .hgignore.

like image 84
Edward Avatar answered Oct 07 '22 19:10

Edward