Problem
TeamCity-invoked Git Clean-Up is not running, but git pack-object processes run on the server for a long time and consume a lot of memory.
Cause
git pack-object is a Git maintenance process that can be invoked by Git automatically after such Git commands as git fetch or git commit are run:
https://git-scm.com/docs/git-maintenance
Resolution
Disable automatic in-place Git maintenance and let TeamCity run Git GC on schedule.
Note: A server health report is generated when the nightly/scheduled Git GC fails to clean up a Git mirror. Pay extra attention to such reports when disabling Git auto-maintenance. Otherwise, the lack of GC/maintenance will slow down server-side Git operations.
On TeamCity 2026.1.1 and newer
Add the following internal property.
teamcity.server.git.maintenance.auto.enable=false
On TeamCity 2026.1 and older
Containerized
Run the container with the following environment variables.
environment:
GIT_CONFIG_COUNT: "1"
GIT_CONFIG_KEY_0: "maintenance.auto"
GIT_CONFIG_VALUE_0: "false"
Non-containerized
Run the following command on the TeamCity server.
git config set --global maintenance.auto false
Comments
0 comments
Please sign in to leave a comment.