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

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →