Skip to content

Instantly share code, notes, and snippets.

@joshuaquek
Created December 20, 2018 07:57
Show Gist options
  • Save joshuaquek/221e988df929610ae9568a3b73e7176a to your computer and use it in GitHub Desktop.
Save joshuaquek/221e988df929610ae9568a3b73e7176a to your computer and use it in GitHub Desktop.
Remove Files that you have pushed before you added .gitignore or before you added any new file types to .gitignore.
Summary: Remove Files that you have pushed before you added .gitignore or before you added any new file types to .gitignore.
git rm -r --cached . # Untrack all of your files
git add . # Retrack all of your files, now with .gitignore-ed files taken into consideration
git commit -m ".gitignore fix" # Commit your changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment