Adding a .gitignore file to an existing project will prevent untracked files being added to the working tree but the files will still remain at the staging area (Git Index).
But not all is lost and it is possible to remove the files we want to ignore from Git Index.
git rm -r --cached . git add .
Subscribe to Hunger has no scenic route
Get the latest posts delivered right to your inbox