Skip to content

Instantly share code, notes, and snippets.

@willread
Created May 15, 2013 17:11
Show Gist options
  • Save willread/5585578 to your computer and use it in GitHub Desktop.
Save willread/5585578 to your computer and use it in GitHub Desktop.
Remove filename.extension and all references to it from all branches of a Git repo.
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch filename.extension' --prune-empty --tag-name-filter cat -- --all
git push origin master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment