Skip to content

Instantly share code, notes, and snippets.

@emrekilinc
Created December 22, 2013 16:25
Show Gist options
  • Save emrekilinc/8084913 to your computer and use it in GitHub Desktop.
Save emrekilinc/8084913 to your computer and use it in GitHub Desktop.
Remove a file from git history
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch config/recipes/*' \
--prune-empty --tag-name-filter cat -- --all
git push origin master --force
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment