Optimization of the remote GIT repository - mainly Heroku

I recently added huge files to my local repo and pushed these files outside of other repositories. After I realized this, I did some search queries on this topic and completely deleted these files using git reset. I also did some other things to optimize the repo (git gc, repack). Now my local repo copy is below 100 MB with over 400 MB. The problem is that my heroku site repo is still listed as 400 MB, and I'm not sure if I need something to reflect all the changes in the remote repo?

+4
source share
2 answers

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.

+7
source

Check out https://github.com/heroku/heroku-repo

 heroku repo:gc -a appname 

It's pretty easy to call a Jenkins instance and call it from time to time from your build server.

+1
source

All Articles