Alex Rivera | Logout

Ignoring directories in Git repositories on Windows

Asked 2008-12-05T12:17:28.657
1594

How can I ignore directories or folders in Git using msysgit on Windows?

Edit
Report

2 Answers

244

By default, Windows Explorer will display .gitignore when in fact the file name is .gitignore.txt.

Git will not use .gitignore.txt

And you can't rename the file to .gitignore, because Windows Explorer thinks it's a file of type gitignore without a name.

Non command line solution: you can rename a file to .gitignore. and it will create .gitignore

answered 2010-07-22T11:23:07.430
17

Also in your \.git\info projects directory there is an exclude file that is effectively the same thing as .gitignore (I think). You can add files and directories to ignore in that.

answered 2011-02-10T10:12:00.060

Your Answer