Last Updated: February 25, 2016
·
919
· wolfman0511

.gitignore not working

Example .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)
You would like it if debug.log and nbproject/ did not appear in the untracked files list.

Solution:

git rm . -r --cached
git add .