My .gitignore
file seems to be being ignored by Git - could the .gitignore
file be corrupt? Which 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 debug.log
and nbproject/
not to appear in the untracked files list.
Where should I start looking to fix this?
.gitignore
file usesANSI
orUTF-8
encoding. If it uses something else likeUnicode BOM
, it's possible that Git can't read the file. – ADTC Dec 14 '17 at 12:39echo "file" > .gitignore
in PowerShell, the file had a UCS-2 encoding! – MarioDS Apr 5 '18 at 14:52git rm --cached debug.log nbproject/
– Gayan Weerakutti May 29 '18 at 9:40