Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo size increased from 2 to 9 Gig #42

Open
stalebbeik opened this issue May 24, 2017 · 3 comments
Open

Repo size increased from 2 to 9 Gig #42

stalebbeik opened this issue May 24, 2017 · 3 comments

Comments

@stalebbeik
Copy link

stalebbeik commented May 24, 2017

I am using the following versions:
Centos 6.5
git 2.0.5
git-lfs-migrate 0.2.5

I am trying to prepare a repository that is in Gerrit which has eight large files over 100 MB. So in order to migrate and push it to Github with LFS support, I used git-lfs-migrate. I noticed that the size of the converted repository has increased from 2 to 9 Gig. There is a new "lfs" subdirectory with 2 GB and "objects" subdirectory has increased from 2 to 7.4 Gig. Does anyone have an idea what might be the issue? Here are my commands:

$ git clone --mirror ssh://username@gerrit/repo.git
$ java -jar /home/user/git-lfs-migrate.jar -s repo.git -d repo-converted.git ".csv" ".xls" "*.rtf"
$ cd repo-converted.git
$ git fsck

Also, I noticed that all the commits in the converted repository have a new hash. I am guessing that this is an expected behavior.

@cosimo-dw
Copy link

I also faced similar problems. And here are what I found online:

  1. the "objects" subdirectory after the migration is in loose object format (i.e. uncompressed). git will compress them on push before uploading files, or you can use "git gc" to manually pack them, after which you will see a huge decrease of repo size.
  2. hashes of commits are all based on files. And since large files are all changed from blob to pointers new hash is expected.

@stalebbeik
Copy link
Author

Thanks for the response. Is this the specific git command that you suggest to run?
git gc --prune=now --aggressive

@cosimo-dw
Copy link

I didn't try with --aggressive nor --prune=now, which are probably up to your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants