Git: Removing the object(s) associated with an old commit
Posted
by user362893
on Stack Overflow
See other posts from Stack Overflow
or by user362893
Published on 2010-06-09T21:34:42Z
Indexed on
2010/06/10
3:32 UTC
Read the original article
Hit count: 103
git
A couple of months ago I added and committed a release tarball to a git code repository. A couple of commits later, I removed the file and committed the removal. This one file was nearly 10x the size of the whole repository, so the presence of that file in .git slows cloning down significantly. At this point there have been hundreds of commits since the pair of commits that added and removed the file.
Is there a way to remove the two commits which cancel out (the add and the remove) and also remove the copy of the file in .git, without hosing the repository?
Thanks..
© Stack Overflow or respective owner