0

What happens if I track all of the pdf files:

git lfs track "*.pdf"

But another developer that has not installed git-lfs pushes a new pdf file? Does it use text-pointer or the full binary? Is the server responsible for versioning the binary blobs or is it the client?

If it is server-side I could basically track the binary types once, and not worry about other developers pushing binary blobs to git (this is gitlab).

dashesy
  • 2,596
  • 3
  • 45
  • 61

1 Answers1

1

Git lfs manages everything client side, it uses smudge and clean filters when you pull/push files.

So if another developer pushe the same pdf file without using git-lfs as well you're in trouble as it will overwrite the pointer git-lfs replaces the actual file with in the git repo (you still have history though).

If that developer pushes a new pdf file without having git-lfs installed it will behave as git would normally do, pushing the binary into the git repo.

The versioning is handled by the backend (git backend not lfs) for the pointer itself, as it is now just text, but the client is responsible for reading the pointer and retrieving the correct blob from the lfs endpoint you specified in that repo's .git/config.

This behavior is independent from the lfs implementation you're using - currently the client also does not publish metadata with the blobs themselves so no way the backend can manage this.

danf
  • 2,629
  • 21
  • 28
  • Thanks, it seems `lfs` cannot fix the problem with developers who push binary files then. I wish I could do something server-side. – dashesy Apr 01 '16 at 05:01
  • Take a look at [Artifactory](https://www.jfrog.com/confluence/display/RTF/Git+LFS+Repositories), It has extensible [user plugins](https://www.jfrog.com/confluence/display/RTF/User+Plugins) support that you can leverage to implement your own logic for such situations. Unfortunately until they resolve the issue I pointed out you can only rely on the checksum of the blob. – danf Apr 03 '16 at 05:47
  • This sounds almost perfect, and would be even more perfect! if it could be integrated with gitlab. – dashesy Apr 06 '16 at 19:50
  • You could also implement a server-side hook, no? – julien_c Sep 22 '20 at 11:28
  • server-side hooks can only be used in on-prem installations of supporting git servers... if you use a SaaS provider you're out of luck – danf Sep 23 '20 at 12:22