Neil Barnwell
Neil Barnwell

Reputation: 42075

How do I change the template .hgignore used for new repositories?

When I create a new repository, I can ask TortoiseHG to give me a .hgignore file. Is there a way that I can customise what that file will look like, rather than having to go and get one manually from somewhere every time?

Upvotes: 3

Views: 396

Answers (2)

Christian Specht
Christian Specht

Reputation: 36421

Like Tim already said in his comment, apparently it's not possible to do this.

Take a look at the following issue from TortoiseHG's bug tracker:
#966 Include some reasonable defaults in .hgignore on repo creation

Quotes from this link, both by Steve Borho (THG project lead):

This topic comes up on the Mercurial mailing list once a year or so and Matt always shoots it down. There is already support for user level ignore files; one could add these globs to a global file and be done with it.

and:

If a user has files or directories that they always want to ignore, they can add those to a global ignore file without having to introduce any new behaviors in THG.

So putting the things you always want ignored in a user-global ignore file seems to be the only option (even though it's not exactly what you're asking for):

Upvotes: 1

Dominik
Dominik

Reputation: 134

It's an old question, put still popped up as the first result on google, so here is an update:

In the TortoiseHg settings under the tab TortoiseHg users can specify the path of a Repo Skeleton. You can put your predefined .hgignore there, and it will be automatically copied during hg init.

See also:
#3569 Allow user-defined default .hgignore file when creating a new repository
TortoiseHG Docs

Upvotes: 2

Related Questions