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

  1. If you haven’t already, install git
  2. If you haven’t already, add the file to be ignored into your .gitignore
  3. Open up cmd on windows or terminal on mac.
  4. CD to your project directory(cd **project directory**)
  5. git rm -r --cached .
  6. git add .
  7. git commit -m "Clean up ignored files"
Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge