35

I was just wondering if anyone could clear up some confusion I have about using Git Large File Storage.

When creating your new repository, I know how to track certain files with git lfs track, but how do you specify where those files will be stored?

For example, in the project I am working on there are a number of png and wav files. These are being tracked using git lfs track. The Git LFS website says that they are stored on a remote server, but I cannot find out where that information is in our repository.

In addition, when a second user clones the repo, the project contains only pointers to the LFS objects. How can they find/use the url for the remote where the actual files are stored?

(We are using Bitbucket and a local system git for our repo.)

Jeff
  • 3,829
  • 1
  • 31
  • 49
Bryan
  • 383
  • 3
  • 5
  • 4
    Not sure why this was down-voted. I checked all the requirements for posting questions and this met all of them. It was also not posted on the site already... – Bryan Oct 03 '15 at 21:35
  • your tags are quite bad, bitbucket, atlassian and gitattibutes do no belong here. instead may add something like git-lfs – max630 Oct 04 '15 at 05:30
  • 4
    @max630 Yes I tried that at first but I suppose when you first create an account you cannot define custom tags. I made do with relevant tags that would draw in people with pertinent information. So I'm not sure I would necessarily consider that bad. Unless there was already a git-lfs tag, and I don't believe there was when I asked the question. Thank you though, I'll consider that next time. – Bryan Oct 05 '15 at 06:07
  • Note: BitBucket Cloud now supports LFS: http://stackoverflow.com/a/38450750/6309 – VonC Jul 19 '16 at 06:15

3 Answers3

11

The Git Lfs website says that they are stored on a remote server, but I cannot find out where that information is in our repository.

They're not stored in the repository, at least in a technical sense. git-lfs adds a second area, the large file storage area, which is a peer of your repository. The large files are stored there.

I would have expected BitBucket to present this information in a meaningful way on their website.

In addition, when a second user clones the repo, the project contains only pointers to the LFS objects.

They need to install git-lfs. That is the program responsible for downloading and uploading the large file content.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • 1
    Turns out the large files were never being sent to the second area. Thank you, this helped a lot. (Along with searching through the bitbucket settings for awhile.) – Bryan Oct 05 '15 at 06:13
  • 8
    **"git-lfs adds a second area, the large file storage area, which is a peer of your repository"** Finally! An answer that makes sense. Thank you so much. How did you know this? Can you provide a link or series of git commands that prove your answer? I've been looking at git-lfs docs for an hour and _where_ large files are put is conspicuously absent. How are people comfortable not knowing where their files went? – Jeff Nov 11 '16 at 13:03
10

The Git-LFS storage server is specified by the lfs.url property, for example:

git config lfs.url https://github.com/foo/bar.git/info/lfs

The default (when lfs.url is unset) is to derive the Git-LFS server URL from the URL of the remote using some heuristics like: git@github.com:foo/bar.git -> https://github.com/foo/bar.git/info/lfs

You can view the current server for each remote with:

git lfs env | grep Endpoint

Note: current git-lfs (2.13.3) supports only HTTP/HTTPS and file:// endpoint protocols, so you can't push LFS objects to a remote clone over SSH, for example. A workaround is to mount the remote repository over sshfs and use file://.

alexei
  • 2,031
  • 1
  • 26
  • 28
0

As far as I understand, by default they are stored at GitHub's servers. You could also setup a server locally (they provide API documentation and what they call "reference server implementation") for that, and specify the server in git configuration

Josh Correia
  • 3,807
  • 3
  • 33
  • 50
max630
  • 8,762
  • 3
  • 30
  • 55
  • Other Git hosting providers besides GitHub also support git-lfs, so this answer is factually incorrect. The answer also does not explain where the files are if not in the repos itself. See Edward's answer. – Jeff Nov 11 '16 at 13:08