Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would like to create some defaults for my .hgignore files in TortoiseHG/Mercurial

I'd like to make it so that every time I create a new repository, certain filters automatically get added to my .hgignore files by default.

For example, for C# projects, I would like these to be added:

glob:bin/*
glob:obj/*

Is this possible? How?

If it can't be automated, is it at least safe to copy the .hgignore file from one repository to another?

like image 808
devuxer Avatar asked Nov 23 '09 20:11

devuxer


2 Answers

I use ~/.hgignore and just cp that into my repo.

In my ~/.hgrc:

[ui]
ignore.other = ~/.hgignore

I just put the really obvious stuff in that one. And copy it for project specific stuff.

I don't think its quite what you're asking for as there is no automation, but it does the trick.

Windows users, see Ry4an's comment below.

like image 60
dlamotte Avatar answered Jan 03 '23 14:01

dlamotte


Just to clarify, it is safe to copy a .hgignore from one repos to another, it is just a plain old simple text file.

like image 39
Mizipzor Avatar answered Jan 03 '23 14:01

Mizipzor