Environment specific files and gitignore March 1st, 2010

I love my Mac for doing development! Textmate and Passenger make it my all-time favorite environment to develop Ruby / Rails in. It does have some very specific “junk” files I don’t want in my git, though.

In the beginning I would include all those files in every project’s .gitignore file. This worked since all my colleagues also work on a Mac with Passenger & TextMate. Recently I’ve come across people with different setups, which made the project’s .gitignore look like this:

.DS_Store
Thumbs.db
tmp/restart.txt
.idea
.todo
.bundle
.rake_tasks~

After some searching I found you can easily setup a global .gitignore which ignores your environment specific files. Doing so is easy:

# ~/.gitignore
.DS_Store
tmp/restart.txt
.rake_tasks~
.idea

And added this to my global git config

git config --global core.excludesfile ~/.gitignore 

This all makes your .gitignore file much cleaner and more relevant for the project itself.

tags: , , l

31 Responses to “Environment specific files and gitignore”

  • about 1 year ago mensagens para orkut said

    How do I qualify paths in the .gitignore file. Thank you for the encouragement! (And to doener as well of course for the inspiration)

    I will send in a suitably amended patch with in the next day or so – I’m half asleep right now, :-(

    Regards,

    Alex

  • 11 months ago zeturf said

    specific files and gitignore :

    .rake_tasks~ .idea

    and add this variabl ~/.gitignore

    good tips

  • 11 months ago Go ped said

    How do I qualify paths in the .gitignore file. Thank you for the encouragement! (And to doener as well of course for the inspiration)

  • 11 months ago ahddf said

    Thank your for the article which is great I think. I expect some more really good things like that in the near future.

  • 10 months ago Best Doctors in Houston said

    I already expected this article and my expectation is not really as perfect as this one.

  • 10 months ago Drucker Vergleich said

    i really like info on this blog, i will bookmark it

  • 10 months ago Drucker im test said

    it’s very good blog post, i’ll save it as my favorite

  • 10 months ago depuy lawsuit said

    This is so good to use. The ideas behind this is so good. Keep up the good work.

  • 10 months ago resveratrol said

    Hi, this article was quite nicely written, and it also contains numerous practical details. I appreciated your expert manner of writing this article. You haveve created it simple for me to recognize. Please keep up the good articles.

  • 6 months ago respiratory exam questions said

    I am currently trying to set up a development environment for learning Ruby. The environment will primarily be for getting to grips with the language, I like to discuss more about this thanks for sharing. Regards, Jack

  • 6 months ago teknik said

    Thank you for this information. I’ve been looking for something like this for quite a while. Keep up the good work, cheers! klimat thailand lången tips filippinerna

  • 6 months ago minoterie said

    I will get to know more new information. Even the website layouts and the designs impress me a lot. Minoterie pour farine

  • 5 months ago restaurang karlstad said

    Good info this, I really enjoy this blog!

  • 5 months ago synas pÃ¥ google said

    Great blog! Hope you will post more of these things!

  • 5 months ago bilverkstad växjö said

    Good post! You have outdone yourself again ruby! Thx for this blog.

  • 5 months ago double cut saw said

    Just saying thanks will not just be enough, for the fantastic clarity inside your writing. I put a link to your blog at my site, hope you don’t mind?

  • 5 months ago Esmalte Metal said

    I appreciated your expert manner of writing this article. You haveve created it simple for me to recognize

  • 5 months ago snoskottning vasteras said

    Great info, I started to link this site to all my friends. platslageri vasteras

  • 4 months ago Aluminum Wallet said

    You can rely on our resume writers, as you count on yourself. Thanks because it¡¯s the useful fact

  • 4 months ago Wisefixer Review said

    Hi I attempted to sign up to your RSS and the link seems to be broken. How can i get around this? Regards!|Its always good to get some hints like you share for blog posting.

  • 4 months ago Houston granite countertops said

    Local per-repo rules can be added to the .git/info/exclude file in your repo. These rules are not committed with the repo so they are not shared with others. This method can be used for locally-generated files that you don’t expect other users to generate, like files created by your editor.

  • 4 months ago dual saw said

    Then the ad_box would add this cpm value to the URL query string (the clicker needs to pass through scoop for a redirect before leaving the site anyway

  • 4 months ago dual saw said

    telecommunication meanings into the area of human interaction and conversation, such that even offline can be used in contrast to the common usage of online. Thanks.

  • 3 months ago onthebroadway said

    In Ireland religion is taught in a subject called holy Education which is necessary in many schools for the Junior record, but available as an option for the Leaving diploma.

  • 3 months ago San Francisco Relocation said

    Great Article! I always have troubles with evironment specific files.

  • 3 months ago Peanut Machines For Sale said

    This method can be used for locally-generated files that you don’t expect other users to generate, like files created by your editor.

  • 19 days ago plummer vinson syndrome said

    These rules are not committed with plummer vinson syndrome the repo so they are not shared with others. This method can be used for locally-generated files that you don’t expect other users to generate, like files created by your editor.

  • 17 days ago ireo new launch said

    Raheja Builder Gurgaon launched luxury residential Project Raheja revanta Sector 78 in unique design with peaceful city life atmosphere. raheja new launch

  • 4 days ago erp manufacturing software said

    Good post! You have outdone yourself again ruby! Thx for this blog.

  • 3 days ago Chandler Real Estate said

    Great blog. Thanks for sharing.

  • about 1 hour ago cv help said

    I really enjoy this blog. Thanks.

Leave a Reply