Skip to content

Instantly share code, notes, and snippets.

@camsaul
Last active November 27, 2017 20:42
Show Gist options
  • Save camsaul/52fe1576cd751e7a0a60 to your computer and use it in GitHub Desktop.
Save camsaul/52fe1576cd751e7a0a60 to your computer and use it in GitHub Desktop.
Git remove binary files
git filter-branch --force --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch *.elc" HEAD && git push --force
@camsaul
Copy link
Author

camsaul commented Nov 27, 2017

Delete (remote) tags, which might be holding on to the files:

#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d

See: https://gist.github.com/okunishinishi/9424779

@camsaul
Copy link
Author

camsaul commented Nov 27, 2017

Might want to disable signing when doing filter-branch or otherwise it will mess up commit messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment