Home > Software design >  'git lfs fetch' found 1 object, what does it mean?
'git lfs fetch' found 1 object, what does it mean?

Time:09-24

In order to backup some GitHub repositories, I followed this tutorial, cloned those repositories with the --mirror option and then fetched Git LFS. Sometimes the output is simple:

$ git lfs fetch --all
fetch: Fetching all references...

However, for some repositories, the output would be:

$ git lfs fetch --all
fetch: 1 object found, done.
fetch: Fetching all references...

Both would create an empty folder lfs/tmp without downloading anything. So what does "1 object found" mean? Why is there a difference between repositories?

Git LFS doc didn't explain the output.

CodePudding user response:

Answer from GitHub Discussions by bk2204 (Git LFS maintainer):

Hey,

In order to find how many objects need to be fetched, Git LFS walks the history. "1 object found" means that it walked the history and found a single LFS pointer file. The reason you're probably seeing this message is that an empty file is its own pointer, and thus it will report a single object if you have an empty file in your repository. However, it won't actually download anything because it doesn't need to in that case.

  • Related