From 19511543cf4dde64dccbb4d0343ca4f497a98431 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Wed, 5 Apr 2017 13:14:05 +0200 Subject: [PATCH] docs: updated tutorials for Git LFS and Mercurial Largefiles. --- docs/tutorials/git-lfs-ext.rst | 93 +++++++++++++++++++++++++++++++++ docs/tutorials/hg-large-ext.rst | 30 +++++++++++ docs/tutorials/tutorials.rst | 1 + 3 files changed, 124 insertions(+) create mode 100644 docs/tutorials/git-lfs-ext.rst diff --git a/docs/tutorials/git-lfs-ext.rst b/docs/tutorials/git-lfs-ext.rst new file mode 100644 index 00000000..281ba01f --- /dev/null +++ b/docs/tutorials/git-lfs-ext.rst @@ -0,0 +1,93 @@ +.. _git-lfs-files: + +|git| LFS Extension +=================== + + +Git Large File Storage (or LFS) is a new, open-source extension to Git that +aims to improve handling of large files. It does this by replacing large files +in your repository—such as graphics and videos—with simple text pointers. +|RC| Server includes an embedded LFS object store server, allowing storage of +large files without the need for an external object store. +Git LFS is disabled by default, globally, and for each individual repository. + +.. note:: + + |RC| implements V2 API of Git LFS. Please make sure your git client is + using the latest version (2.0.X recommended) to leverage full feature set + of the V2 API. + + + +Enabling Git LFS +++++++++++++++++ + +Git LFS is disabled by default within |RC| Server. + +To enable Git LFS Globally: + + - Go to :menuselection:`Admin --> Settings --> VCS` + + - Scroll down into `Git settings` + + - Tick `Enable lfs extension` + + - Save your settings. + +Those settings apply globally to each repository that inherits from the defaults +You can leave `lfs extension` disabled globally, and only enable it per +repository that would use the lfs. + + +.. note:: + + You might want to adjust the global storage location at that point, however + we recommend leaving the default one created. + + +Installing and using the Git LFS command line client +++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Git LFS aims to integrate with the standard Git workflow as seamlessly +as possible. To push your first Git LFS files to an existing repository +Download and install the git-lfs command line client +Install the Git LFS filters:: + + git lfs install + +This adds the following lines to the .gitconfig file located in your home directory:: + + [filter "lfs"] + clean = git-lfs clean %f + smudge = git-lfs smudge %f + required = true + +The above change applies globally, so it is not necessary to run this for +each repository you work with. Choose the file types you would like LFS to +handle by executing the git lfs track command. The git lfs track command +creates or updates the .gitattributes file in your repository. +Change to your cloned repository, then execute git add to ensure updates +to the .gitattributes are later committed:: + + git lfs track "*.jpg" + git add .gitattributes + +Add, commit, and push your changes as you normally would:: + + git add image.jpg + git commit -m "Added an image" + git push + +When pushed, the Git tree updates to include a pointer to the file actual +file content. This pointer will include the SHA256 hash of the object and its +size in bytes. For example:: + + oid sha256:4fa32d6f9b1461c4a53618a47324ee43e36ce7ceaea2ad440cc811a7e6881be1 + size 2580390 + + +The object itself will be uploaded to a separate location via the Git LFS Batch API. +The transfer is validated and authorized by |RC| server itself. + +If give repository has Git LFS disabled, a proper message will be sent back to +the client and upload of LFS objects will be forbidden. diff --git a/docs/tutorials/hg-large-ext.rst b/docs/tutorials/hg-large-ext.rst index d00b72a1..e44b5429 100644 --- a/docs/tutorials/hg-large-ext.rst +++ b/docs/tutorials/hg-large-ext.rst @@ -9,6 +9,36 @@ has a large files extension which tracks their revisions by checksums. This means that the large files are only downloaded when they are needed as part of the current revision. This saves both disk space and bandwidth. + +Enabling HG Largefiles +++++++++++++++++++++++ + +Mercurial Largefiles extension is disabled by default within |RC| Server. + +To enable Mercurial Largefiles Globally: + + - Go to :menuselection:`Admin --> Settings --> VCS` + + - Scroll down into `Mercurial settings` + + - Tick `Enable largefiles extension` + + - Save your settings. + +Those settings apply globally to each repository that inherits from the defaults +You can leave `largefiles extension` disabled globally, and only enable it per +repository that would use the largefiles. + + +.. note:: + + You might want to adjust the global storage location at that point, however + we recommend leaving the default one created. + + +Installing and using the |hg| Largefiles +++++++++++++++++++++++++++++++++++++++++ + To find out more, see the |hg| `Large Files Extensions Documentation`_. To configure the large files extension, you need to set up your diff --git a/docs/tutorials/tutorials.rst b/docs/tutorials/tutorials.rst index 201c3fee..82750dfe 100644 --- a/docs/tutorials/tutorials.rst +++ b/docs/tutorials/tutorials.rst @@ -12,6 +12,7 @@ then please send a request to support@rhodecode.com deploy-from-host hg-large-ext + git-lfs-ext multi-instance-setup scaling-best-practices squash-commits