Skip to content

Instantly share code, notes, and snippets.

@addiedx44
Created April 3, 2013 02:32
Show Gist options
  • Save addiedx44/5297991 to your computer and use it in GitHub Desktop.
Save addiedx44/5297991 to your computer and use it in GitHub Desktop.
Removes a file from a git repository by rewriting history.
# $1 below refers to whatever filename you want removed from the repository
git filter-branch --index-filter "git rm --cached --ignore-unmatch $1" --prune-empty -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment