Monday, May 16, 2016

When .gitignore is not working (git status is showing files to be ignored)

The issue:
# git status keep showing files that already been added to .gitignore

.gitignore
    test.txt

The Story:
# git check-ignore -v test.txt doesn't return anything
# ==> which means .gitignore is not working
# This answer suggests that maybe it caused by encoding issue thus git cannot handle the .gitignore correctly.
# Open .gitnore using Notepad++, Verify the encoder, and go to menu Encoding, Convert to UTF-8-BOM.
# git status, TA-DA!

No comments: