tags:

views:

4669

answers:

4

anyone know how i can ignore directories in git using msysgit on windows?

+15  A: 

Create a file named .gitignore in your projects directory. Ignore directorys by entering the directory name into the file (with a slash appended):

dir_to_ignore/

More info here: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html

stew
+12  A: 

cheers..

I had some issues creating a file in windows explorer with a . at the beginning.

a workaround was to go into the commandshell and create a new file using "edit"

sf
+7  A: 

to instruct GIT to ignore certain files or folders, you have to create .gitignore file.

but in windows explorer you have to provide a name for the file, you just cannot create file with just extension, the trick is that create a empty text file and go to command prompt and change the name of the file to .gitignore

ren "New Text Document.txt" .gitignore

now open the file with your favorite text editor and add the file/folder names you wish you ignore. you can also use wildcards like this *.txt

hope it answers you question

Mahes
Or just: echo dir_to_ignore/ > .gitignore
Oliver
+4  A: 

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 explorer thinks its a file of type gitignore with no name.

Non command line solution:

You can rename a file to ".gitignore." and it will create ".gitignore"
brainwavedave