Skip to content

Instantly share code, notes, and snippets.

@aks
Created February 23, 2018 18:27
Show Gist options
  • Select an option

  • Save aks/b649da7b11df0c9a93cc4ec664563279 to your computer and use it in GitHub Desktop.

Select an option

Save aks/b649da7b11df0c9a93cc4ec664563279 to your computer and use it in GitHub Desktop.
Permanently remove files from a repo
#!/bin/bash
# wanted to remove "doc" directory and all of it's contents
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch -r -f doc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment