Useful .gitignore entries

In case your new to git, according to the documentation “A gitignore file specifies intentionally untracked files that git should ignore.” Well, that sounds pretty useful, especially if we’re developing with cakephp or using an editor that loves to place random files within our working tree.
.gitignore files are generally placed in the root of our $GIT_DIR but can be placed anywhere within the working tree, similar to .htaccess files. Along with .gitignore files, you can also place your .gitignore directives in .git/info/exclude, or what I like to do, place it in ~/.gitexclude and adding
[core]
excludesfile = /Users//.gitexclude

to my ~/.gitconfig. This allows us to specify some files that we generally don’t want to be commiting to our repository. Here’s what I currently use in my ~/.gitexclude.
###
# ECLIPSE IDE project files
##
.project
.cache
.cache/*
.settings
.settings/*

###
# Espresso project files
###
*.esproj

###
# system SWAP, TMP and BACKUP files
###
*~
*.swp
*.bak

###
# Mac OS X directory preferences
###
.DS_Store

###
# CakePHP tmp content
###
*/tmp/cache/*
*/tmp/logs/*
*/tmp/sessions/*
*/tmp/tests/*