Make changes in . gitignore file. Run git rm -r --cached . command. Run git add . command. git commit -m "Commit message" or just git commit or continue working.