Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Consider cleaning up the .git folder to reduce the large repo size #30

@kmilodenisglez

Description

@kmilodenisglez

Hi. I just cloned this repo and it ended up being 63.7MB. The biggest file is a 63.3MB pack in .git/objects/pack.

To see the 10 biggest files, run this from the root directory:

$ git verify-pack -v .git/objects/pack/pack-323d180074a64abef2844ad9a64f7c72d8a67d1a.idx | sort -k 3 -n | tail -10
To see what each file is, run this:

$ git rev-list --objects --all | grep [first few chars of the sha1 from previous output]

ex: $ git rev-list --objects --all | grep 676ab14f0f5878612078764e705f132181a90364

Most of the files are dependencies of fabric-chaincode/vendor and trustid-sdk/node_modules that were included by mistake in some initial commit. The next step would be to clean up your git by removing all of those unnecessary files.

One option is to use the bfg-repo-cleaner tool.
In all these steps bfg is an alias for java -jar bfg.jar

step 1, clone a fresh copy of your repo, using the --mirror flag:
$ git clone --mirror https://github.com/hyperledger-labs/TrustID.git

step 2:
$ bfg --delete-folders "{vendor,node_modules}" TrustID.git

step 3:
cd Trust.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive

Then verify:
git count-objects -v

Finally, once you're happy with the updated state of your repo, push it back up (note that because your clone command used the --mirror flag, this push will update all refs on your remote server):
$ git push

to know more about this issue:

https://git-scm.com/book/es/v2/Los-entresijos-internos-de-Git-Los-objetos-Git
https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery
18F/C2#439

Metadata

Metadata

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