Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git gc --aggressive push to server?

Tags:

git

It seems like git gc --aggressive really cleans up my repo, but when I do git push everything is already up-to-date. Is there a way to clean up the server?

like image 782
Dan Rosenstark Avatar asked Feb 03 '12 20:02

Dan Rosenstark


People also ask

What does git gc -- aggressive do?

The --aggressive option causes git gc to spend more time on its optimization effort. This causes git gc to run slower but will save more disk space after its completion. The effects of --aggressive are persistent and only need to be run after a large volume of changes to a repository.

When should you not run git gc `? *?

auto below for how to disable this behavior. Running git gc manually should only be needed when adding objects to a repository without regularly running such porcelain commands, to do a one-off repository optimization, or e.g. to clean up a suboptimal mass-import.

How would you force git to trigger garbage collection?

The easiest option would be to use a scheduled task in windows or a cron job in Unix to run git gc periodically. This way you don't even need to think about it.

Should I run git gc?

You should consider running git gc manually in a few situations: If you have just completed a git filter-branch . Recall that filter-branch rewrites many commits, introduces new ones, and leaves the old ones on a ref that should be removed when you are satisfied with the results.


1 Answers

I know that Github will run git gc periodically as the Github support mentions in this thread.

I don't know if you can force it yourself though.
I didn't see such a service in the Github hooks.

like image 136
VonC Avatar answered Oct 09 '22 02:10

VonC