Skip to main content

Since thisThis functionality is not directly supported by Git. However, try at least ayou can use git gc, or the more recent (Git 2.30+) git maintenance to decrease the repo size.

git maintenance run --task gc
git maintenance run --task loose-objects --task incremental-repack

ThatThis won't be your initial statethe same as re-cloning the repo, but it should be smallerresult in a smaller repo.

Since this is not directly supported, try at least a git gc, or the more recent (Git 2.30+) git maintenance

git maintenance run --task gc
git maintenance run --task loose-objects --task incremental-repack

That won't be your initial state, but should be smaller.

This functionality is not directly supported by Git. However, you can use git gc or the more recent (Git 2.30+) git maintenance to decrease the repo size.

git maintenance run --task gc
git maintenance run --task loose-objects --task incremental-repack

This won't be the same as re-cloning the repo, but it should result in a smaller repo.

Source Link
VonC
  • 1.3m
  • 548
  • 4.6k
  • 5.5k

Since this is not directly supported, try at least a git gc, or the more recent (Git 2.30+) git maintenance

git maintenance run --task gc
git maintenance run --task loose-objects --task incremental-repack

That won't be your initial state, but should be smaller.