3 ms·
"It is really hard to lose stuff" Indeed. This also means that garbage keeps piling up in git repos. This is how I make sure, I do lose stuff eventually: htt
by mg 4y ago
"It is really hard to lose stuff"
Indeed. This also means that garbage keeps piling up in git repos.
This is how I make sure, I do lose stuff eventually:
https://github.com/no-gravity/git-gc-all-repos.sh https://github.com/no-gravity/git-gc-all-repos.sh
A script that goes through all my repos and performs garbage collection.
- donatj 4y agoDisk space is cheaper than lost data.
- bloopernova 4y agoTrue, but wouldn't the reduction in size make it a little quicker to transfer over slow networks?
- Arnavion 4y agoI know your link says you don't want to do `gc --aggressive --prune all`, but for anyone who does: a) That still leaves objects referenced by the reflog, so you may want to `reflog expire --expire=now --all` first if your reflog is full of rebases etc that you don't need, and b) you may want to run gc twice because the second time compacts a tiny bit more than the first.
- Slade_ 4y agoYou might be interested in the `git maintenance` subcommand that was introduced in Git 2.31. It can do per-repository automatic background garbage collection on a configurable schedule, among other things.