As with the local repo, git gc is an operation that cleans up all free objects (for example, drops for your files that are no longer part of the story). When you have access to the remote control, you can do it directly. If there is absolutely no way to do this, then you are stuck waiting until one of your taps starts git gc --auto . This is guaranteed in the end, therefore, if there is actually a problem with a repo with 400 MB (for example, paying more for hosting), this is not a problem. Anyone who gets / pulls / clones from a repo will just get what they need to get, 100 MB.
I believe github also periodically runs git gc in repositories; I don't know if Heroku is doing something like this.
source share