Skip to content

GIT .gitignore Cleanup

Jason Lewis edited this page Oct 14, 2021 · 3 revisions

Up

Use this guide if you have files in your GIT repository that should be ignored based on changes to your .gitignore file.

  1. Commit all changes including your .gitignore file.
  2. Remove everything from the repo:
    git rm -r --cached .
    
    IMPORTANT: --cached flag will ensure you don't actually delete your source files, just the index.
  3. Re-add files:
    git add .
    
  4. Commit the changes:
    git commit -m ".gitignore cleanup"
    
  5. Push to remote (optional):
    git push origin <branch>
    
Clone this wiki locally