Git does not store extra copies of files that are moved or copied. If the content is the same, the only thing that git stores is the new tree structure(s).
Details on the Git object model: http://git-scm.com/book/en/Git-Internals-Git-Objects
git gc
is the common way to do regular house-keeping on a repository, give it a shot and see if your repository shrinks.
If that doesn't do it (sometimes git gc
will choke, particularly on repositories with a lot of binary data), try using git repack
. It'll often take quite a while, but it should shrink the repository, if at all possible. Try this:
git repack -adf --window=250 --depth=250 --window-memory=1024M
Note the --window-memory
option; if your machine has enough memory you might just get away without using this option, but if not it should prevent git repack
from failing from running out of memory. In my experience, setting it to half or less of the available memory usually works fine.