How to add global ignore file in git

This tutorial assumes that you already download and install GIT: http://git-scm.com/downloads. Note that I've done this in windows 7. Also please make sure that you add GIT_HOME/bin folder in your path.

Steps:
1.) Create a new file C:\Program Files (x86)\Git\global_gitignore.

2.) In my case I want to ignore the eclipse related files, so my global_gitignore file contains:
.project
.settings
target
.classpath
target
.DS_Store

3.) Open command prompt and execute:
git config --global core.excludesfile "C:\Program Files (x86)\Git\global_gitignore"
//on mac
git config --global core.excludesfile /Users/myAccount/.global_gitignore
How to add global ignore file in git How to add global ignore file in git Reviewed by Edward Legaspi on Tuesday, March 05, 2013 Rating: 5

No comments:

Powered by Blogger.