Skip to content

Commit

Permalink
Add understanding git lfs section
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Nov 1, 2024
1 parent 5f208d0 commit f13af8a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/contributing/forking_publishing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,38 @@ Ensure the tools are up to data from time to time with:
$(cd docs ; pip install -r requirements.txt --upgrade)

Edit, build, commit, push as usual.

Understanding git lfs
---------------------

Since git lfs is not that common in the wild, it may be tricky to get the hang
of it.

First of all, the basics:
lfs replaces binaries files with pointers, and stores the binaries outside the
git repository, in an external server.

When you do ``git clone/pull``, by default lfs will also download the binaries
at the "smudge" step.
You can change this behaviour by setting globally
``git lfs install --skip-smudge`` or temporally with ``GIT_LFS_SKIP_SMUDGE=1``
environment variable.

If during a clone or pull you obtain the error:

::

Encountered n file(s) that should have been pointers

That simply means that someone pushed files to remote that should have been
pointers (defined in the *.gitattributes* file).
And to fix is simple:

.. shell::

$git add --renomalize .
$git commit -m "Convert binary files to pointers"
$git push

And advise the committer to ensure he has git lfs enabled with
``git lfs install``.

0 comments on commit f13af8a

Please sign in to comment.