Skip to content

Instantly share code, notes, and snippets.

@perguth
Last active September 3, 2015 10:15
Show Gist options
  • Select an option

  • Save perguth/07ce2bfff353e86ca6a2 to your computer and use it in GitHub Desktop.

Select an option

Save perguth/07ce2bfff353e86ca6a2 to your computer and use it in GitHub Desktop.
Remove a certain file completely throughout all history from a GIT repository branch.
# replace FILE (eg. `subfolder/file.md`) and BRANCH
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch FILE' \
--prune-empty --tag-name-filter BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment