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?>
Specifically for Windows users: If you have untracked files and clearing/removing the cached files is not working. Try opening PowerShell and converting the .gitignore file to UTF-8 encoding:
$Myfile = Get-Content .\.gitignore`
$Myfile | Out-File -Encoding "UTF8" .gitignore
You need to only do this once to encode the .gitignore file for that directory, and since the file is then encoded correctly, whenever you edit the file in the future it should work. I believe this is due to a glitch with GitHub not being about to read non UTF-8 encoding for a .gitignore file. As far as I'm aware this issue has not yet been resolved for Windows. It's not too big of a deal, just a pain to debug when it's not working.