Creating a .gitignore File inside Windows Explorer


One of the first things i was frustrated by when i first started using the distributed source control Git on windows was creating a .gitignore file as i couldn’t only ever seem to figure it out using the command line – but today i found an interesting hack.

imageWhat is a .gitignore file?

When using the ever-growing-in-popularity Source Control provider Git ( or the Windows implementation MsyGit ( you often have files that you do not want to check into your source control.

This is similar to using the SVN:ignore command when using SVN.

To accomplish this you create a file in the root of your local repository called .gitignore that you enter all the filenames you would like to avoid having in your repository (when working with Visual Studio projects this is often your .suo and if you are a R# fan, your _Resharper folders).

Example .gitignore file

#OS junk files

#Visual Studio files


#Project files

#Subversion files

# Office Temp Files


The Problem

When creating a .gitignore file in Windows Explorer you are met with a pretty annoying error message

“… You must type a file name …”


The Solution

Create your new text file by right-clicking in a folder and select New > Text File


When entering a new file-name, enter .gitignore. (with an extra period on the end)

Windows removes the end period, and leaves you with just .gitignore

Pretty cool eh?