TeamCity Caches take a lot of space

I need to cleanup space for my server and i saw a message in the documentation saying to not delete cache only if jetbrain ask you to do so.

I'm wondering what cache folder is safe to reset in teamcity?

In the server i got Git that takes 3 GO of the 5 GO cache folder


Can i reset the git and git revisions cache?

In see also a folder Git for the agent that takes 3 GO 


The temp folder take 3 GO. Can i reset or delete the content?




It can be manually deleted to clear caches: they will be restored automatically as needed. It is safer to delete the directory while server is not running. However, deleting the cache can have implications on build performance. TeamCity runs Git garbage collection automatically to clean these caches: it removes the data that is no longer required.

 Git cache contains mirrors of Git-based repos. If we clear it, it will just be rebuilt to a similar size over time. The Git revision cache specifically stores information about commits and revisions that TeamCity gets from Git repositories. This includes details such as commit hashes, commit messages, author information, and other metadata associated with each revision. As you mentioned that Git that takes 3G of the 5G cache folder, it is considerred increasing the available space for the caches.

The purpose of this caching is to avoid getting the same Git revisions unnecessarily over and over again during the build process. When a build is triggered, TeamCity first checks the revision cache to see if it already contains information about the desired Git revision. If that information is found in the cache, TeamCity can use it directly without having to fetch revisions from the remote Git repository again. This helps save time and resources, especially if the same revision is being made.

TeamCity analyses disk space and provides the Disk Usage report. It detects all local and remote artifact directories configured on the server and analyses the disk space occupied by builds in these storages.

Accroding to your description, it seems that you are looking for TeamCity Data Clean-Up | TeamCity On-Premises Documentation. It allows an automatic deletion of old and no longer necessary build data to free your disk space.


Ok, thanks i will cleanup cache and add space later to fix the problems.


Please sign in to leave a comment.