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:

[user]
	name = Ben Bullock
	email = benkasminbullock@gmail.com
[core]
        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
*.o
# Core files (files created when an executable program crashes).
*.core
# Perl build process related
blib
pm_to_blib
Makefile.old
MYMETA.json
MYMETA.yml
MANIFEST.bak

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

.cleanok

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

# Ignore tarballs
*.tar.gz


Copyright © Ben Bullock 2009-2017. All rights reserved. For comments, questions, and corrections, please email Ben Bullock (benkasminbullock@gmail.com) or use the discussion group at Google Groups. / Privacy / Disclaimer