Skip to content

Instantly share code, notes, and snippets.

View storm1kk's full-sized avatar
🏠
Yao!

Andrey Ustinov storm1kk

🏠
Yao!
View GitHub Profile
Remove file from git repository (history)
SOLUTION: This is the shortest way to get rid of the files:
1. check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files
2. (optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files
3. (optional) git rev-list --objects --all | grep #{SHA_FROM_#_3} - to check what files those are