git
isn't a server-client architecture, so there is no git server.
I read somewhere that git prunes reflog (& other garbage collection) in 90 days. Now there is no server that checks for the last reflog entry & waits for 90 days to do GC. So how does it work? Who schedules background git pruning?
Asked
Active
Viewed 113 times
2

Kamal Banga
- 181
- 1
- 6
1 Answers
2
git gc
ends up being run automatically during the normal use of a repo.
For example, in "Do I ever need to run git gc
on a bare repo?", Jefromi mentions:
It's also true that enough commands run it automatically that you essentially never have to.
In the case of a bare repo, it'sreceive-pack
that invokesgc --auto
.
So if you are doing anything with the repo (clone/push/pull), git gc
will run and checks with its internal reflog if 90 days are reached or not.
It is a local operation to the repo, with a local reflog, and it doesn't need a server at all.