4 | | == SVN Access == |
| 3 | https://gitlab.version.fz-juelich.de |
| 4 | |
| 5 | == Git Large File Storage (LFS) == |
| 6 | |
| 7 | Without LFS |
| 8 | - every git repository contains the complete history of all files including every version of big binaries |
| 9 | - cloning such a repository requires to download all these binaries in all versions |
| 10 | - bad performance of Git repositories larger than 1GB |
| 11 | With LFS |
| 12 | - same git commands can be used |
| 13 | - only pointers to the binary data are stored in the repository, the binaries ares stored on a separate disk on the server |
| 14 | - only one version of large binaries has will be downloaded, if the repository is cloned |
| 15 | |
| 16 | On the JSC gitlab server, a single file may not exeed the size of 50Mb, otherwise the push will be rejected: |
| 17 | |
6 | | svn list https://svn.version.fz-juelich.de/gitlab |
| 19 | > git push origin master |
| 20 | Counting objects: 5, done. |
| 21 | Delta compression using up to 8 threads. |
| 22 | Compressing objects: 100% (5/5), done. |
| 23 | Writing objects: 100% (5/5), 553 bytes | 0 bytes/s, done. |
| 24 | Total 5 (delta 3), reused 0 (delta 0) |
| 25 | remote: b0fd97d641cf2db0129faee2c4eeee768a9169ac..b6e4e93d5ec12229d42dd120548afe42183801d9 1048576 |
| 26 | remote: |
| 27 | remote: ------------------------------------------------------------------------------------------------------- |
| 28 | remote: Your push was rejected because it contains files larger than 50 MB. |
| 29 | remote: You might want to consider using git-lfs instead (see https://trac.version.fz-juelich.de/gitlab/wiki/). |
| 30 | remote: ------------------------------------------------------------------------------------------------------- |
| 31 | remote: |
| 32 | remote: Offending files: |
| 33 | remote: - bigFile.avi |
| 34 | remote: |
| 35 | To ssh://git@gitlab.version.fz-juelich.de:10022/user/test.git |
| 36 | ! [remote rejected] master -> master (pre-receive hook declined) |
| 48 | === First usage === |
| 49 | This command specifies the files which should use LFS and also creates or updates .gitattributes. |
| 50 | {{{ |
| 51 | git lfs track "*.bin" # or git lfs track myBigFile.bin |
| 52 | }}} |
| 53 | |
| 54 | '''Important:''' Add .gitattributes to the repository. |
| 55 | {{{ |
| 56 | git add .gitattributes |
| 57 | }}} |
| 58 | |
| 59 | Now you may use git like before to add a file to the repository. |
| 60 | {{{ |
| 61 | git add myBigFile.bin |
| 62 | git commit -m "Add binary file using lfs" |
| 63 | git push origin master |
| 64 | }}} |
| 65 | |
| 66 | === Further commands === |
| 67 | |
| 68 | If you have many LFS objects, cloning with git lfs clone is faster. |
| 69 | {{{ |
| 70 | git lfs clone |
| 71 | }}} |
| 72 | |
| 73 | If you have already checked out a repository and want to replace the object links (e.g. ExamplePointerFile) with the binary contents, use {{{git lfs pull}}} or |
| 74 | {{{ |
| 75 | git lfs fetch # downloads objects with batch mode |
| 76 | git lfs checkout # changes objects to binary files |
| 77 | }}} |
| 78 | |
| 79 | Show files which use LFS |
| 80 | {{{ |
| 81 | git lfs ls-files |
| 82 | }}} |
| 83 | |
| 84 | === Documentation === |
| 85 | - https://github.com/git-lfs/git-lfs/wiki |
| 86 | - https://git-lfs.github.com/ |
| 87 | |
| 88 | === Support === |
| 89 | For further questions, send a mail to |
| 90 | version-admin.jsc@fz-juelich.de |