Skip to content

gc should also run git gc #3616

@berquist

Description

@berquist

Apparently gc doesn't run git gc and I was surprised to find that this is part of the reason why my ~/.julia was so big. It's likely the checkout hasn't been GCed since it was created several years ago:

/home/eric/.julia/registries/General
[eric@osmium]$ stat .
  File: .
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 259,2   Inode: 51916279    Links: 32
Access: (0755/drwxr-xr-x)  Uid: ( 1000/    eric)   Gid: ( 1000/    eric)
Access: 2023-09-08 21:47:21.531384624 -0400
Modify: 2023-07-16 18:14:52.968403148 -0400
Change: 2023-07-16 18:14:52.968403148 -0400
 Birth: 2020-04-29 22:20:04.255378475 -0400
/home/eric/.julia/registries/General
[eric@osmium]$ du -sh .git
8.7G    .git
/home/eric/.julia/registries/General
[eric@osmium]$ git gc
Enumerating objects: 753532, done.
Counting objects: 100% (753532/753532), done.
Delta compression using up to 32 threads
Compressing objects: 100% (341727/341727), done.
Writing objects: 100% (753532/753532), done.
Total 753532 (delta 409869), reused 751283 (delta 407620), pack-reused 0
/home/eric/.julia/registries/General
[eric@osmium]$ du -sh .git
700M    .git

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions