问题
I think I get the mechanics of lfs and its method of tracking the binary files via pointers and only cloning data as needed but I cannot get a solid confirmation where lfs is storing the bulk data. In my case I suspect lfs is keeping the data local because my github repository is tiny (175KB!) relative to the project (Source+Config:72KB, Content:140.7MB) and the local .git directory is much larger (1.2GB).
When I run git lfs env
I get the following (left out the bulk of the report, showing what seems related):
Endpoint (s05_testinggrounds_remote)=https://github.com/rebusb/S05_TestingGrounds.git/info/lfs (auth=basic)
...
LocalMediaDir=D:\Unreal Projects\Udemy C++ S05\TestingGRounds\..git\lfs\objects
...
LfsStorageDir=D:\Unreal Proejcts\Udemy C++ S05\TestingGrounds\.git\lfs
...
My intuition says the files are local, the reported size from github is correct, and not to worry, but it contradicts what I have read about github lfs here, and git-lfs files here. Everything I read says it stores them on a peer or a different server, but how do you identify that server location? I read that the Endpoint reported in the env command should be the location but then the reported size on github is wrong.
Can someone clear up the difference between Endpoint and the LfsStorageDir or explain how to find the actual server/location of the lfs data?
回答1:
Git LFS will, by default, only download the data that you need in order to check out a commit. When it does download data, it downloads it from the location you see in Endpoint
to a subdirectory of the LfsStorageDir
. New objects you create are also stored in that same subdirectory of LfsStorageDir
until you push them.
By default, the origin
remote is used, which is labeled as Endpoint=
; other remote values are only used if you specify git lfs fetch <remote>
. When you push to a remote, the pre-push hooks pushes the relevant LFS data to that remote, using the Endpoint
location for that remote. If you want to push all the LFS data, you can use git lfs push --all <remote>
.
Many hosting providers (like GitHub) provide a separate large file storage area for your data that is accessible using the standard Git LFS client. It isn't possible to see the files directly on the server, since they are only accessible using the web interface or via the LFS client.
来源:https://stackoverflow.com/questions/55084646/difference-between-git-lfs-env-endpoint-and-lfsstoragedir