Skip to content

The .git/ directory takes 4 GB per build on Fedora Stable x86-64 buildbot #789

Closed

Description

@vstinner

After seeing issue gh-788, I checked the size of the .git/ directory on the Fedora Stable x86-64 buildbot worker. It takes 4.1 GB, but this size is reduced to 274 MB after running gc gc.

bash-5.3$ du -sh .git
4.1G	.git

bash-5.3$ git gc
(...)

bash-5.3$ du -sh .git
274M	.git

I see that the "ARM64 Windows" and "wasm32-wasi" buildbots use a custom Git configuration to use a shallow clone:

            git_options=dict(
                # Do a full shallow clone for every build
                mode="full",
                method="clobber",
                shallow=True,
                # Disable the default, if set
                filters=None,
            ),

Should we use a shallow clone on all buildbot workers to reduce the .git/ size? Currently, we use:

                    # "git clean -fdx": remove all files which are not tracked
                    # by Git, ignoring the .gitignore rules (ex: remove also
                    # ".o" files).
                    mode="full",
                    method="fresh",
                    # Partial (blobless) clone: only fetch commit and tree
                    # objects, blobs are fetched on demand during checkout.
                    filters=["blob:none"],

cc @zware @stratakis

Activity

  1. zware commented on Sep 9, 2026

    @zware
    Member

    If git gc is effective, maybe we could add a post-clean step for that?

  2. zware commented on Sep 14, 2026

    @zware
    Member

    I've implemented the git gc step in #790 and have been watching disk usage drop significantly on my ware-debian-x86 worker, so hopefully it's helping other workers as well.

  3. vstinner commented on Sep 14, 2026

    @vstinner
    MemberAuthor

    Aha, interesting. Let me check some buildbot workers:

    • Fedora Stable x64-64: 48 build directories, 24 GB
    • Fedora Stable AArch64: 48 build directories, 24 GB
    • Fedora Stable ppc64le: 48 build directories, 21GB

    Oh wow, I'm honestly impressed. Previouslty, the disk usage was between 84 GB and 146 GB. So between 21 and 24 GB is WAY better!

    I also checked a single build directory on Fedora Stable x64-64: .git/ takes only 275 MB. That's way better that the 4.1 GB I saw previously! I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions