Dec 15

Some suggestions for .gitignore

This is more of a personal note. You may find it useful too.

Here’s how to ignore files and folders using Git. You can create a file “.gitignore” and place in the files and folders that you wish to ignore (separated with a line break).

In the file: “./.gitignore”

Here’s a list of standard things to do a .gitignore. It ignores the thumbnail files generated by Mac OSX and Windows. (I’m on Windows Vista.) You can place this on the top folder of your Git project:

nbproject
.DS_Store
Thumbs.db
Desktop.ini

“nbproject” is for NetBeans.

In the file: “./app/.gitignore”

Well, if you use CakePHP, you may want to add an additional .gitignore file in your CakePHP app directory:

tmp/**/*
config/database.php

I am open to suggestions what other files or folders are good to ignore but these are all I can recall. You can read more about gitignore at kernal.org.

Possibly related:

  1. How to set up VirtualHost in Ubuntu
  2. Ubuntu is so hard, but I like it
  3. NetBeans 6.5 released
  4. WordPress uploads files in the wrong folders?

“Some suggestions for .gitignore”
one comment

  1. Wow, that “no comments” button is not that intuitive.

    Anyway, note that there’s also .git/info/exclude which is not checked into the repository itself (or something). Check the FAQ (http://git.or.cz/gitwiki/GitFaq).

    Thanks for the article!

    I use Netbeans for Ruby and PHP and everything else, too…

    Jul 21

Leave your comment.


WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.