Suggestion: Allow repository owners to trigger garbage collection

CodeFloe runs [cron.git_gc_repos] (TIMEOUT: 900s) with default arguments, so unreachable objects from history rewrites, force-pushes, or deleted branches stay in the bare repository for Git’s default two-week prune grace period and continue counting towards the storage quota. Users who strip large files from history have to wait two weeks, ask an admin, or recreate the repository to reclaim space.

Adding a manual git gc trigger in repository settings would let owners handle this directly:

  • Run a timed git gc with a shorter prune window (or --prune=now behind a repository lock) to avoid racing with active pushes.
  • Enforce rate limiting to prevent abuse, coordinated via the existing HA leader or a per-repository lock.

Gitea tracks a related proposal for an owner maintenance section (#36214). In the short term, a clean-up request channel for post-rewrite quota recovery would also help.

Are there specific storage or GC policies on CodeFloe that constrain this?

Thanks, good idea, and it’s on its way: https://codefloe.com/arbinel/arbinel/pulls/325

One detail: Forgejo keeps a reflog for every repository, so rewritten history stays reachable for 30 days before Git’s two-week prune window even starts. A plain git gc wouldn’t free anything.

Repository owners will get a Run garbage collection button in the repository settings. It drops the reflog entries no branch or tag reaches any more, prunes the objects they kept, and updates the size counted against your quota. Objects from the last 15 minutes are kept so running pushes are safe. Each repository can run it once a day. Commits a pull request still refers to, LFS objects and forks aren’t affected.

It goes live on CodeFloe with the next release. For next time: Site feedback is the right place for CodeFloe itself, such as quotas, limits and policies. A feature for the forge software, like this one, is best opened as an issue at https://codefloe.com/arbinel/arbinel/issues, where Arbinel’s features are planned and discussed.

Thanks for the quick turnaround! Noted on arbinel/arbinel for next time.