Skip to content

Instantly share code, notes, and snippets.

@dostiharise
Created August 21, 2014 13:40
Show Gist options
  • Save dostiharise/bc2ea7665a1a1af0c360 to your computer and use it in GitHub Desktop.
Save dostiharise/bc2ea7665a1a1af0c360 to your computer and use it in GitHub Desktop.
Remove already committed files that match your updated ".gitignore"
# List committed files that match updated ".gitignore"
$ git ls-files -i --exclude-from=.gitignore
# Remove those above files from the commit.
$ git rm --cached `git ls-files -i --exclude-from=.gitignore`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment