### Install git-sizer using go install Source: https://github.com/github/git-sizer/blob/master/docs/BUILDING.md Use this command to get the latest release of git-sizer. The executable will be placed in your Go bin directory. ```bash go install github.com/github/git-sizer@latest ``` -------------------------------- ### Bootstrap Go dependencies Source: https://github.com/github/git-sizer/blob/master/docs/BUILDING.md Run this script to install Go if it's not already installed or to set up necessary dependencies for building. ```bash script/bootstrap ``` -------------------------------- ### Get git-sizer help Source: https://github.com/github/git-sizer/blob/master/README.md Display available options and usage information for git-sizer. ```bash git-sizer -h ``` -------------------------------- ### Git Sizer non-verbose output example Source: https://github.com/github/git-sizer/blob/master/README.md This example shows the typical non-verbose output of git-sizer, highlighting repository statistics and their level of concern. It includes footnotes referencing specific commit SHAs and paths for large objects. ```shell $ git-sizer [...] | Name | Value | Level of concern | | ---------------------------- | --------- | ------------------------------ | | Biggest checkouts | | | * Number of directories [1] | 1.11 G | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | * Maximum path depth [1] | 11 | * | * Number of files [1] | ∞ | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | * Total size of files [2] | 83.8 GiB | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [1] c1971b07ce6888558e2178a121804774c4201b17 (refs/heads/master^{tree}) [2] d9513477b01825130c48c4bebed114c4b2d50401 (18ed56cbc5012117e24a603e7c072cf65d36d469^{tree}) ``` -------------------------------- ### Analyze Git Repository with Verbose Output Source: https://github.com/github/git-sizer/blob/master/README.md Use the `--verbose` option to get a detailed breakdown of repository statistics, including object counts, sizes, and history structure. The output is presented in a table indicating levels of concern for each metric. ```bash $ git-sizer --verbose Processing blobs: 1652370 Processing trees: 3396199 Processing commits: 722647 Matching commits to trees: 722647 Processing annotated tags: 534 Processing references: 539 | Name | Value | Level of concern | | ---------------------------- | --------- | ------------------------------ | | Overall repository size | | | | * Commits | | | | * Count | 723 k | * | | * Total size | 525 MiB | ** | | * Trees | | | | * Count | 3.40 M | ** | | * Total size | 9.00 GiB | **** | | * Total tree entries | 264 M | ***** | | * Blobs | | | | * Count | 1.65 M | * | | * Total size | 55.8 GiB | ***** | | * Annotated tags | | | | * Count | 534 | | | * References | | | | * Count | 539 | | | | | | | Biggest objects | | | | * Commits | | | | * Maximum size [1] | 72.7 KiB | * | | * Maximum parents [2] | 66 | ****** | | * Trees | | | | * Maximum entries [3] | 1.68 k | * | | * Blobs | | | | * Maximum size [4] | 13.5 MiB | * | | | | | | History structure | | | | * Maximum history depth | 136 k | | | * Maximum tag depth [5] | 1 | | | | | | | Biggest checkouts | | | | * Number of directories [6] | 4.38 k | ** | | * Maximum path depth [7] | 13 | * | | * Maximum path length [8] | 134 B | * | | * Number of files [9] | 62.3 k | * | | * Total size of files [9] | 747 MiB | | | * Number of symlinks [10] | 40 | | | * Number of submodules | 0 | | [1] 91cc53b0c78596a73fa708cceb7313e7168bb146 [2] 2cde51fbd0f310c8a2c5f977e665c0ac3945b46d [3] 4f86eed5893207aca2c2da86b35b38f2e1ec1fc8 (refs/heads/master:arch/arm/boot/dts) [4] a02b6794337286bc12c907c33d5d75537c240bd0 (refs/heads/master:drivers/gpu/drm/amd/include/asic_reg/vega10/NBIO/nbio_6_1_sh_mask.h) [5] 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c (refs/tags/v2.6.11) [6] 1459754b9d9acc2ffac8525bed6691e15913c6e2 (589b754df3f37ca0a1f96fccde7f91c59266f38a^{tree}) [7] 78a269635e76ed927e17d7883f2d90313570fdbc (dae09011115133666e47c35673c0564b0a702db7^{tree}) [8] ce5f2e31d3bdc1186041fdfd27a5ac96e728f2c5 (refs/heads/master^{tree}) [9] 532bdadc08402b7a72a4b45a2e02e5c710b7d626 (e9ef1fe312b533592e39cddc1327463c30b0ed8d^{tree}) [10] f29a5ea76884ac37e1197bef1941f62fda3f7b99 (f5308d1b83eba20e69df5e0926ba7257c8dd9074^{tree}) ``` -------------------------------- ### Build Release Artifacts Source: https://github.com/github/git-sizer/blob/master/docs/RELEASING.md Execute this command to build release ZIP files for the specified version. The output will be placed in the 'releases/' directory. ```bash make releases VERSION=$VERSION ``` -------------------------------- ### Create and Push Release Tag Source: https://github.com/github/git-sizer/blob/master/docs/RELEASING.md Use this snippet to create a signed tag for a new version and push it to the origin repository. ```bash VERSION=1.2.3 git tag -as v$VERSION git push origin v$VERSION ``` -------------------------------- ### Run git-sizer on a repository Source: https://github.com/github/git-sizer/blob/master/README.md Navigate to your repository directory and execute the git-sizer command. No options are required for basic analysis. ```bash git-sizer [