threads / discuss / 6831

User-wide ignore list

Subject: User-wide ignore list

## tl;dr

11 messages between Feb 15, 2007 and Feb 15, 2007.

replies: 10people: 5as markdown or json

Matthieu Moy· Feb 15, 2007, 10:20 UTC · lore
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
Nguyen Thai Ngoc Duy· Feb 15, 2007, 11:00 UTC · re: Johannes Schindelin · lore

Re: User-wide ignore list

On 2/15/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 7 quoted lines
> 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· Feb 15, 2007, 11:00 UTC · re: Johannes Schindelin · lore

Re: User-wide ignore list

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
> 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
Johannes Schindelin· Feb 15, 2007, 11:37 UTC · re: Matthieu Moy · lore

Re: User-wide ignore list

Hi,
[Cc'ed Duy, as he raised the same concerns.]
On Thu, 15 Feb 2007, Matthieu Moy wrote:
Show 11 quoted lines
> 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

Junio C Hamano· Feb 15, 2007, 11:30 UTC · re: Johannes Schindelin · lore

Re: User-wide ignore list

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
> 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.

Andy Parkins· Feb 15, 2007, 11:12 UTC · re: Matthieu Moy · lore

Re: User-wide ignore list

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
Johannes Schindelin· Feb 15, 2007, 11:59 UTC · re: Andy Parkins · lore

Re: User-wide ignore list

Hi,
On Thu, 15 Feb 2007, Andy Parkins wrote:
Show 7 quoted lines
> 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· Feb 15, 2007, 13:06 UTC · re: Johannes Schindelin · lore

Re: User-wide ignore list

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
Johannes Schindelin· Feb 15, 2007, 15:23 UTC · re: Andy Parkins · lore

Re: User-wide ignore list

Hi,
On Thu, 15 Feb 2007, Andy Parkins wrote:
Show 11 quoted lines
> 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

← back to recent threads