Clean up ignored files that have been committed already
clear up ignored files with these 3 git commands
Fri, 04 Jan 2019
Everyone once in a while I will forget to add DS_Store to my .gitignore and inevitably end up committing the file to my project. Once you commit the file, git will keeping on adding the file to your commits even if you added it to your .gitignore after the fact. These commands will help you clear that pesky file out
- If you haven’t already, install git
- If you haven’t already, add the file to be ignored into your .gitignore
- Open up cmd on windows or terminal on mac.
- CD to your project directory(
cd **project directory**
) git rm -r --cached .
git add .
git commit -m "Clean up ignored files"