pep-dortmund / homepage

Our new homepage
https://pep-dortmund.org
MIT License
7 stars 4 forks source link

Use git lfs for pdfs and images? #110

Open maxnoe opened 7 years ago

maxnoe commented 7 years ago

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

bixel commented 7 years ago

We would then need to update the CONTRIBUTING.md

The-Ludwig commented 1 year ago

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 commented 1 year ago

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