Set up a global .gitignore for Github for Windows

This page explains how to set up a global .gitignore file for users of GitHub for Windows.

The .gitconfig file for GitHub for Windows lives in the user's home directory. In my case, on Windows Vista, the location of the .gitconfig file is C:\Users\ben\.gitconfig. To set up a global gitconfig, I use a directory C:\Users\ben\config containing a file called global.gitignore, and in .gitconfig I add the following:

	name = Ben Bullock
	email =
        excludesfile = C:/Users/ben/config/global.gitignore

The file global.gitignore looks like this:
# Emacs backup files
# Emacs backups of hidden files, like ".gitignore.~3~"
# Object files
# Core files (files created when an executable program crashes).
# Perl build process related

# A file which says it is Ok to run "make clean" in this directory.


# C compiler files created when -o is not used.

# Ignore tarballs

Copyright © Ben Bullock 2009-2017. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( / Privacy / Disclaimer