# "exclude" and ".gitignore" for everyone

4 messages from 2009-06-01 to 2009-06-01. Participants: Nikos Chantziaras, Brian Gernhardt, Matthieu Moy.
Thread: https://gitlist.dev/t/19628

## Nikos Chantziaras, 2009-06-01 13:46

Subject: "exclude" and ".gitignore" for everyone
Message-ID: <h00m32$gs0$2@ger.gmane.org>
URL: https://gitlist.dev/e/h00m32%24gs0%242%40ger.gmane.org

```
Hello.

I'm a first-time Git user.  I found out how to ignore files with Git. 
For example I've put "*.[oa]" and "*~" in ./git/info/exclude.  However, 
the rest of the persons doing commits in the public repository might not 
have those entries.  Is everyone required to put those entries in 
"exclude" themselves or does Git allow for those to be automatically 
added next time they do a "git pull"?

```

## Brian Gernhardt, 2009-06-01 13:58

Subject: Re: "exclude" and ".gitignore" for everyone
Message-ID: <E6F58E6B-4ECF-4A55-9249-9A8BBFBDBC24@silverinsanity.com>
URL: https://gitlist.dev/e/E6F58E6B-4ECF-4A55-9249-9A8BBFBDBC24%40silverinsanity.com
In-Reply-To: <h00m32$gs0$2@ger.gmane.org>

```

On Jun 1, 2009, at 9:46 AM, Nikos Chantziaras wrote:

> I'm a first-time Git user.  I found out how to ignore files with  
> Git. For example I've put "*.[oa]" and "*~" in ./git/info/exclude.   
> However, the rest of the persons doing commits in the public  
> repository might not have those entries.  Is everyone required to  
> put those entries in "exclude" themselves or does Git allow for  
> those to be automatically added next time they do a "git pull"?

If you commit a .gitignore, it will be used by everyone.  .git/info/ 
exclude is for your personal excludes.  Generally, I'd suggest putting  
build products in .gitignore and your editor's garbage in exclude.   
For example:

project/.gitignore:
-------------------
*.o
*.a
random.tmp

project/.git/info/exclude:
--------------------------
.*.swp
*~
/my-todo.txt

If you add and commit the .gitignore file it will be picked up by  
everyone, while whatever backups, temp files, notes, or whatever you  
use can be kept private in your exclude file.

~~ Brian

```

## Nikos Chantziaras, 2009-06-01 14:16

Subject: Re: "exclude" and ".gitignore" for everyone
Message-ID: <h00nqe$mj4$1@ger.gmane.org>
URL: https://gitlist.dev/e/h00nqe%24mj4%241%40ger.gmane.org
In-Reply-To: <E6F58E6B-4ECF-4A55-9249-9A8BBFBDBC24@silverinsanity.com>

```
Brian Gernhardt wrote:
> On Jun 1, 2009, at 9:46 AM, Nikos Chantziaras wrote:
>> [...]
>> For example I've put "*.[oa]" and "*~" in ./git/info/exclude.  
>> However, the rest of the persons doing commits in the public 
>> repository might not have those entries.  Is everyone required to put 
>> those entries in "exclude" themselves or does Git allow for those to 
>> be automatically added next time they do a "git pull"?
> 
> If you commit a .gitignore, it will be used by everyone.  
> .git/info/exclude is for your personal excludes.  Generally, I'd suggest 
> putting build products in .gitignore and your editor's garbage in 
> exclude.
> [...]
> If you add and commit the .gitignore file it will be picked up by 
> everyone, while whatever backups, temp files, notes, or whatever you use 
> can be kept private in your exclude file.

Thanks, Brian!

```

## Matthieu Moy, 2009-06-01 14:36

Subject: Re: "exclude" and ".gitignore" for everyone
Message-ID: <vpqy6scc975.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqy6scc975.fsf%40bauges.imag.fr
In-Reply-To: <E6F58E6B-4ECF-4A55-9249-9A8BBFBDBC24@silverinsanity.com>

```
Brian Gernhardt <benji@silverinsanity.com> writes:

>  Generally, I'd suggest putting [...] your editor's garbage in
> exclude.

better: put them in a user-wide ignore file.

in ~/.gitconfig:

[core]
        excludesfile = /home/yourlogin/.gitignore

then put whatever you want in $HOME/.gitignore.

-- 
Matthieu

```
