Make git ignore files

Viewed 38462

I'm trying to make git ignore some of my files and I found one description about how you could do this

From: http://github.com/guides/git-cheat-sheet TO IGNORE SOME FILES

Add a file in the root directory called .gitignore and add some files to it: (comments begin with hash) *.log db/schema.rb db/schema.sql

Git automatically ignores empty directories. If you want to have a log/ directory, but want to ignore all the files in it, add the following lines to the root .gitignore: (lines beginning with ‘!’ are exceptions)

log/* !.gitignore

Then add an empty .gitignore in the empty directory:

touch log/.gitignore

So I made a file called .gitignore in my folder for my project and wrote the following in it:

phpMyAdmin/*
nbproject/*
inc/mysql_config.php
!.gitignore

But when I commit, the files isent excluded from the commit...

2 Answers
Related