ThinkRooms is a application development studio at Bandung. We do application development based on web technology. Our services are develop application, PSD/PNG to HTML, and CMS template development. You can check our official website at http://www.thinkrooms.com

 

Gitignore template for ignore some files on git repository

It’s better to have a global .gitignore file that will exclude some files from your repo so you don’t need to write individual .gitignore file for each project. So i found some good resources to help you create your global .gitignore file.

To create your global gitignore you can start by using this Github example

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

Save the file on your home directory if you using Mac like me. You can save it as ~/.gitignore_global and add it by run command on terminal

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

Because most projects that I handle is a Yii Framework project and WordPress so I include some .gitignore rules to my global config like this

# Yii
######################
assets/*
protected/runtime/*

#WordPress
######################
.htaccess
wp-*.php
xmlrpc.php
wp-admin/
wp-includes/
wp-content/uploads/
wp-content/blogs.dir/
wp-content/upgrade/*
wp-content/backup-db/*
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
wp-content/cache/*
wp-content/cache/supercache/*
wp-content/w3tc/*
sitemap.xml
sitemap.xml.gz
readme.html
license.txt
*.log

So my global .gitignore will be looks like this

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Yii
######################
assets/*
protected/runtime/*

#WordPress
######################
.htaccess
wp-*.php
xmlrpc.php
wp-admin/
wp-includes/
wp-content/uploads/
wp-content/blogs.dir/
wp-content/upgrade/*
wp-content/backup-db/*
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
wp-content/cache/*
wp-content/cache/supercache/*
wp-content/w3tc/*
sitemap.xml
sitemap.xml.gz
readme.html
license.txt
*.log

You can find more templates for others frameworks or CMS at https://github.com/github/gitignore

Blog comments powered by Disqus