# User-wide ignore list

11 messages from 2007-02-15 to 2007-02-15. Participants: Matthieu Moy, Johannes Schindelin, Nguyen Thai Ngoc Duy, Andy Parkins, Junio C Hamano.
Thread: https://gitlist.dev/t/6831

## Matthieu Moy, 2007-02-15 10:20

Subject: User-wide ignore list
Message-ID: <vpq4ppnvi1j.fsf@olympe.imag.fr>
URL: https://gitlist.dev/e/vpq4ppnvi1j.fsf%40olympe.imag.fr

```
Hi,

Is there a way to have a per-user ignore list in git?

I'd like to ignore once and for all the backup files of my editor
(*~), which are not necessarily relevant to a project, but definitely
relevant for me regardless of the project.

Thanks,

-- 
Matthieu

```

## Johannes Schindelin, 2007-02-15 10:52

Subject: Re: User-wide ignore list
Message-ID: <Pine.LNX.4.63.0702151152320.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702151152320.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <vpq4ppnvi1j.fsf@olympe.imag.fr>

```
Hi,

On Thu, 15 Feb 2007, Matthieu Moy wrote:

> Is there a way to have a per-user ignore list in git?

It's not really per user, but how about doing it with templates?

Ciao,
Dscho

```

## Nguyen Thai Ngoc Duy, 2007-02-15 11:00

Subject: Re: User-wide ignore list
Message-ID: <fcaeb9bf0702150300g2781cb98u160f28086cd69ecb@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0702150300g2781cb98u160f28086cd69ecb%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.63.0702151152320.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
On 2/15/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Thu, 15 Feb 2007, Matthieu Moy wrote:
>
> > Is there a way to have a per-user ignore list in git?
>
> It's not really per user, but how about doing it with templates?

Templates have no effect on previously created git repositories, does it?
-- 
Duy

```

## Matthieu Moy, 2007-02-15 11:00

Subject: Re: User-wide ignore list
Message-ID: <vpqabzfsn1b.fsf@olympe.imag.fr>
URL: https://gitlist.dev/e/vpqabzfsn1b.fsf%40olympe.imag.fr
In-Reply-To: <Pine.LNX.4.63.0702151152320.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Thu, 15 Feb 2007, Matthieu Moy wrote:
>
>> Is there a way to have a per-user ignore list in git?
>
> It's not really per user, but how about doing it with templates?

Correct me if I'm wrong (I didn't really find a documentation for
templates), but I believe this would only apply to newly created
project. Then, it doesn't apply if I clone the project of someone
using another editor for example, nor to my old projects if I add
something to the list of things I want to ignore.

-- 
Matthieu

```

## Andy Parkins, 2007-02-15 11:12

Subject: Re: User-wide ignore list
Message-ID: <200702151112.06729.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200702151112.06729.andyparkins%40gmail.com
In-Reply-To: <vpq4ppnvi1j.fsf@olympe.imag.fr>

```
On Thursday 2007 February 15 10:20, Matthieu Moy wrote:

> Is there a way to have a per-user ignore list in git?

Yep; in repository-layout.txt it says:

info/exclude::
    This file, by convention among Porcelains, stores the
    exclude pattern list. `.gitignore` is the per-directory
    ignore file.  `git status`, `git add`, `git rm` and `git
    clean` look at it but the core git commands do not look
    at it.  See also: gitlink:git-ls-files[1] `--exclude-from`
    and `--exclude-per-directory`.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

```

## Junio C Hamano, 2007-02-15 11:30

Subject: Re: User-wide ignore list
Message-ID: <7vmz3fd5ea.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmz3fd5ea.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0702151152320.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Thu, 15 Feb 2007, Matthieu Moy wrote:
>
>> Is there a way to have a per-user ignore list in git?
>
> It's not really per user, but how about doing it with templates?

It might be an option to introduce a configuration variable that
points at a file to be used in addition to $GIT_DIR/info/exclude.
Then you can set that variable in ~/.gitconfig.

```

## Johannes Schindelin, 2007-02-15 11:37

Subject: Re: User-wide ignore list
Message-ID: <Pine.LNX.4.63.0702151225130.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702151225130.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <vpqabzfsn1b.fsf@olympe.imag.fr>

```
Hi,

[Cc'ed Duy, as he raised the same concerns.]

On Thu, 15 Feb 2007, Matthieu Moy wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Thu, 15 Feb 2007, Matthieu Moy wrote:
> >
> >> Is there a way to have a per-user ignore list in git?
> >
> > It's not really per user, but how about doing it with templates?
> 
> Correct me if I'm wrong (I didn't really find a documentation for 
> templates), but I believe this would only apply to newly created 
> project.

Yes. However, you can safely call "git init" in an _existing_ repo. It 
does not overwrite existing files.
 
> Then, it doesn't apply if I clone the project of someone using another 
> editor for example, nor to my old projects if I add something to the 
> list of things I want to ignore.

"git clone" implicitly calls "git init"; Therefore you get the templates, 
too. But you're right, if you already edited .git/info/exclude, this will 
not overwrite it.

Of course, you could fiddle with ~/.gitconfig, or even ~/.gitignore, but I 
suggest that you first think about a sane syntax.

Also note that this opens the door for shooting-in-the-foot; files you are 
certain you want ignored can show up in a cloned repo all to easy.

Ciao,
Dscho

```

## Johannes Schindelin, 2007-02-15 11:59

Subject: Re: User-wide ignore list
Message-ID: <Pine.LNX.4.63.0702151259270.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702151259270.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <200702151112.06729.andyparkins@gmail.com>

```
Hi,

On Thu, 15 Feb 2007, Andy Parkins wrote:

> On Thursday 2007 February 15 10:20, Matthieu Moy wrote:
> 
> > Is there a way to have a per-user ignore list in git?
> 
> Yep; in repository-layout.txt it says:
> 
> info/exclude::

Nope. This is per-repo, not per-user.

Hth,
Dscho

```

## Andy Parkins, 2007-02-15 13:06

Subject: Re: User-wide ignore list
Message-ID: <200702151306.33865.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200702151306.33865.andyparkins%40gmail.com
In-Reply-To: <Pine.LNX.4.63.0702151259270.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
On Thursday 2007 February 15 11:59, Johannes Schindelin wrote:

> > info/exclude::
>
> Nope. This is per-repo, not per-user.

Silly me; I forgot to write the last bit of my email :-)

$ ln -sf $HOME/.git/exclude $GIT_DIR/info/exclude

Do that in each of your working checkouts and voila.


Andy

-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

```

## Nguyen Thai Ngoc Duy, 2007-02-15 13:56

Subject: Re: User-wide ignore list
Message-ID: <fcaeb9bf0702150556l6b5f2779re502d9fcee21bac1@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0702150556l6b5f2779re502d9fcee21bac1%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.63.0702151225130.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
On 2/15/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Yes. However, you can safely call "git init" in an _existing_ repo. It
> does not overwrite existing files.

Oh.. that's enough for me :-)
-- 
Duy

```

## Johannes Schindelin, 2007-02-15 15:23

Subject: Re: User-wide ignore list
Message-ID: <Pine.LNX.4.63.0702151620310.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702151620310.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <200702151306.33865.andyparkins@gmail.com>

```
Hi,

On Thu, 15 Feb 2007, Andy Parkins wrote:

> On Thursday 2007 February 15 11:59, Johannes Schindelin wrote:
> 
> > > info/exclude::
> >
> > Nope. This is per-repo, not per-user.
> 
> Silly me; I forgot to write the last bit of my email :-)
> 
> $ ln -sf $HOME/.git/exclude $GIT_DIR/info/exclude
> 
> Do that in each of your working checkouts and voila.

... and next time you edit .git/info/exclude, be very surprised that other 
repos have the change, too.

Ciao,
Dscho

```
