Sometimes, .gitignore be part of the file / folder failed, probably due in newly created files already present in the local cache git repository, so .gitignore on the failure
The solution is to empty the cache about git repository, resubmitted just once
step
1 git -rm -r --cached .
2 git add .
3 git commit -m 'update .gitignore'