Matt Parkins Matt Parkins - 23 days ago 10
Git Question

.gitignore not working

I'm on windows and my

.gitignore
file seems to be being ignored by git - could the .ignore file be corrupt? What file format, locale or culture does git expect?

My
.gitignore
:

#this is a comment
debug.log
nbproject/


Output from
git status
:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# debug.log
# nbproject/
nothing added to commit but untracked files present (use "git add" to track)


I would like it if
debug.log
and
nbproject/
did not appear in the untracked files list.

Where should I start looking to fix this?

Answer

Fixed. Ok, I created the .gitignore file in notepad on windows and it wasn't working. When I viewed the .gitignore file in linux it looked like organised gibberish - perhaps notepad had written out unicode rather than ascii or whatever 8-bit is.

So I rewrote the file on my linux box, and when I pulled it back into windows it works fine! Hurrah!