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

Use git lfs for pdfs and images? #110

Open
maxnoe opened this issue Jun 20, 2017 · 3 comments
Open

Use git lfs for pdfs and images? #110

maxnoe opened this issue Jun 20, 2017 · 3 comments
Labels

Comments

@maxnoe
Copy link
Member

maxnoe commented Jun 20, 2017

This might be better and help keep the source repo clean.

@bixel
Copy link
Member

bixel commented Jun 20, 2017

We would then need to update the CONTRIBUTING.md

@The-Ludwig
Copy link
Contributor

Hi @maxnoe @bixel,
I played around a little bit and added git-lfs for everything in the git-lfs branch. I also updated CONTRIBUTING. I mean the repo is not cleaner, per-se, the files (at least their name) are still there. It is just better to handle.

Before merging that in the master someone should make sure that git-lfs is installed on the server and is working...

@The-Ludwig
Copy link
Contributor

Now I also rewrote the whole history and did some testing. A branch went from 170MiB to 4.5MiB (if the large file objects are excluded).

As far as I understand it, it should also be ok for people who forget to set up git-lfs working in this repository. Then the file is just uploaded the usual way and can be migrated later to git-lfs if needed. Downside is, that the history is rewritten so the commit-hash changes.

Testing:

$ time git clone https://github.com/pep-dortmund/homepage
Cloning into 'homepage'...
remote: Enumerating objects: 8331, done.
remote: Counting objects: 100% (3631/3631), done.
remote: Compressing objects: 100% (2016/2016), done.
remote: Total 8331 (delta 1795), reused 3412 (delta 1610), pack-reused 4700
Receiving objects: 100% (8331/8331), 172.32 MiB | 13.82 MiB/s, done.
Resolving deltas: 100% (4404/4404), done.

real	0m13.828s
user	0m4.289s
sys	0m2.968s
$ time git clone -b git-lfs --single-branch https://github.com/pep-dortmund/homepage
Cloning into 'homepage'...
remote: Enumerating objects: 5470, done.
remote: Counting objects: 100% (3156/3156), done.
remote: Compressing objects: 100% (1707/1707), done.
remote: Total 5470 (delta 1444), reused 3156 (delta 1444), pack-reused 2314
Receiving objects: 100% (5470/5470), 4.51 MiB | 2.02 MiB/s, done.
Resolving deltas: 100% (2914/2914), done.
Filtering content: 100% (319/319), 148.84 MiB | 11.84 MiB/s, done.

real	0m15.442s
user	0m3.810s
sys	0m2.911s

And without git-lfs installed we can get it down to under a second:

Cloning into 'homepage'...
remote: Enumerating objects: 5470, done.
remote: Counting objects: 100% (3156/3156), done.
remote: Compressing objects: 100% (1720/1720), done.
remote: Total 5470 (delta 1439), reused 3142 (delta 1431), pack-reused 2314
Receiving objects: 100% (5470/5470), 4.52 MiB | 14.87 MiB/s, done.
Resolving deltas: 100% (2909/2909), done.

real	0m0.813s
user	0m0.312s
sys	0m0.080s

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

No branches or pull requests

3 participants