2
1
Fork 0

enable "git gc" cron job of gitea #9

Closed
opened 2024-02-26 13:25:30 +01:00 by milahu · 1 comment

by default, gitea does not run git gc so old git objects are not deleted

see gitea's cron.git_gc_repos config

example: run git gc every 3 days

/var/lib/gitea/custom/conf/app.ini

[cron.git_gc_repos]
ENABLED = true
RUN_AT_START = false
SCHEDULE = @every 72h

example: my alchi repo currently has 64MiB
but it should be 21MiB because i removed a branch

see also https://codeberg.org/Codeberg/Community/issues/1494

We do not run the GC cron job in Forgejo, but via this script instead: https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/src/branch/main/hosts/admin/home/git/garbage-collection.sh

Running a garbage collection for 100k repos regularly is too heavy.

Objects are kept for about 30 days in most cases.

same issue on righttoprivacy.onion: http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion/RightToPrivacy/Gitea-Onion_WELCOME_GET_STARTED/issues/4

by default, gitea does not run `git gc` so old git objects are not deleted see gitea's [cron.git_gc_repos](https://docs.gitea.com/next/administration/config-cheat-sheet#cron---garbage-collect-all-repositories-crongit_gc_repos) config example: run `git gc` every 3 days `/var/lib/gitea/custom/conf/app.ini` ``` [cron.git_gc_repos] ENABLED = true RUN_AT_START = false SCHEDULE = @every 72h ``` example: my [alchi](http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/milahu/alchi) repo currently has 64MiB but it should be 21MiB because i removed a branch see also https://codeberg.org/Codeberg/Community/issues/1494 <blockquote> We do not run the GC cron job in Forgejo, but via this script instead: https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/src/branch/main/hosts/admin/home/git/garbage-collection.sh Running a garbage collection for 100k repos regularly is too heavy. Objects are kept for about 30 days in most cases. </blockquote> same issue on righttoprivacy.onion: http://gg6zxtreajiijztyy5g6bt5o6l3qu32nrg7eulyemlhxwwl6enk6ghad.onion/RightToPrivacy/Gitea-Onion_WELCOME_GET_STARTED/issues/4
Owner

Thanks. I also enabled cron.delete_missing_repos cron. So I don't need to run both of these commands anymore manually.

Thanks. I also enabled `cron.delete_missing_repos` cron. So I don't need to run both of these commands anymore manually.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Darktea/Issues_Support_Feedback#9
No description provided.