# Git .gitignore vs exclude file

**URL:** <https://www.ruby-forum.com/t/git-gitignore-vs-exclude-file/154312>\
**Category:** Rails\
**Created:** [November 27, 2008, 4:11pm UTC](https://www.ruby-forum.com/t/git-gitignore-vs-exclude-file/154312 "2008-11-27T16:11:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [November 27, 2008, 4:11pm UTC](https://www.ruby-forum.com/t/git-gitignore-vs-exclude-file/154312/1 "2008-11-27T16:11:39Z")

</div>

I am a bit confused about the different purpose of each.  
I think the .gitignore file belongs in the root of my project and is  
project specific, but that also seems to be the reason for the .git/  
info/exclude file

what happens if they conflict? which one wins.

What is standard practice?

My exclude file looks like this

# git-ls-files --others --exclude-from=.git/info/exclude

log/_.log  
tmp/\*\*/_  
.DS\_Store  
doc/api  
doc/app

I am on Hardy Heron, isn’t a .DS\_Store a mac thang?

Should that all just be in my .gitignore file, which is empty?

Sorry for so many questions, but I can’t find shit about git on the  
internet.(what a twit)

Thanks in advance

TeeDub

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [November 27, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/git-gitignore-vs-exclude-file/154312/2 "2008-11-27T20:50:50Z")

</div>

Hey TeeDub,

Start here: [git(1)](http://www.kernel.org/pub/software/scm/git/docs/)

google is your friend too

Rick

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [November 27, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/git-gitignore-vs-exclude-file/154312/3 "2008-11-27T16:33:24Z")

</div>

On Thu, Nov 27, 2008 at 10:11 AM, Ruby F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> My exclude file looks like this
> 
> # git-ls-files --others --exclude-from=.git/info/exclude
> 
> log/_.log  
> tmp/\*\*/_  
> .DS\_Store  
> doc/api  
> doc/app
> 
> I am on Hardy Heron, isn’t a .DS\_Store a mac thang?

Yes, .DS\_Store is Mac-specific. Since the Mac is a very common platform  
for  
Ruby/Rails work, it’s nice to list that file in your exclusions.

Should that all just be in my .gitignore file, which is empty?

> Sorry for so many questions, but I can’t find shit about git on the  
> internet.(what a twit)

Very hard to believe. 🙂 Here is a good place to look, though:  
[http://git-scm.com/](http://git-scm.com/) .

Regards,  
Craig
