Skip to content

Instantly share code, notes, and snippets.

@cognivator
Last active April 17, 2016 03:36
Show Gist options
  • Save cognivator/aa37d55c7b8bfab6fd9c51d57c871861 to your computer and use it in GitHub Desktop.
Save cognivator/aa37d55c7b8bfab6fd9c51d57c871861 to your computer and use it in GitHub Desktop.
.gitignore cache cleaning
#!/bin/bash
# Run this from the root of a git repo - AFTER YOU COMMIT THE CHANGES YOU CARE ABOUT!
# Then, if you need to keep the deleted files in your working copy (e.g. IDE config files),
# be sure to unstage them before your next commit.
# attribution: http://www.randallkent.com/2010/04/30/gitignore-not-working/
for file in `cat .gitignore` ; do git rm -r --cached $file; done
for file in `cat ~/.gitignore_global` ; do git rm -r --cached $file; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment