Skip to content

Instantly share code, notes, and snippets.

@geraldyeo
Created February 14, 2013 07:04
Show Gist options
  • Select an option

  • Save geraldyeo/4951076 to your computer and use it in GitHub Desktop.

Select an option

Save geraldyeo/4951076 to your computer and use it in GitHub Desktop.
Purge file/dir from repo
[file]
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <filename>' --prune-empty -- --all
[dir]
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch <dir-path>/' --prune-empty -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment