Where are git-lfs files stored? Where are git-lfs files stored? git git

Where are git-lfs files stored?


Answer 1As explained in this video (at 1:27), when you push a file tracked by git lfs it is intercepted and placed on a different server, leaving a pointer in your git repository. As you see in the reference you provide in Question 4, this worked for you.

Answer 2This is a bit more tricky. Reading the documentation for git lfs smudge, we have:

Read a Git LFS pointer file from standard input and write the contents of the corresponding large file to standard output. If needed, download the file's contents from the Git LFS endpoint. The argument, if provided, is only used for a progress bar.

The git lfs endpoint can be found from the output of git lfs env. My "endpoint" is a folder under (but not in) my repository, which makes me think that GitLab creates a git repository on the server in our account space to store binary files.

That said, I don't know how you'd go about backing this up. GitHub provides a git lfs server that's "not in a production ready state," so it'd require some work on your part to set it up such that your binary files are uploaded to a server you administer. If backing up these files is a priority and you don't want to use one of the implementations (Amazon S3, etc), you might try another binary file storage system that works with git, such as git-media, git-annex, git-fat, git-bigstore.... I haven't looked into these options in depth, so couldn't make a recommendation.

Answer 3If the file was not uploaded using git lfs it would have been pushed using git and you'd have a binary file in your git repository. But, yours was uploaded using git lfs as you say in Question 4.

Answer 4Other users of your repository, after having installed git lfs on their local machines, can simply type git lfs pull to bring in the binary file(s) that you pushed using git lfs.