This is my listing of git lfs managed files
$ git lfs ls-files
b1d5dd29dd - file1.zip
27d3073f43 - file2.zip
fb4e699c05 * file3.zip
Why does one file have an asterisk/star (*) beside it, while the others have a dash (-) beside them?
The git lfs wiki seems to indicates that (*) is expected.
https://github.com/github/git-lfs/wiki/Tutorial
git lfs status
shows all clear (nothing to be committed/pushed/staged).
This page suggests:
An asterisk (*) after the OID indicates a LFS pointer, a minus (-) a full object.
But my experience has been the opposite.
For me, the minus (-) indicated a pointer and the asterisk (*) indicated the real large-file in git lfs.
This wasn't documented in the ls-files man page, so I dug into the source code to find the answer.
func lsFilesMarker(p *lfs.WrappedPointer) string {
info, err := os.Stat(p.Name)
if err == nil && info.Size() == p.Size {
return "*"
}
return "-"
}
*
probably means the file on disk is the same size as the one in the repository or index, depends on what's in WrappedPointer.Size
. It was added in this commit, but not explained. Either way, it seems like a poor test as the content can change but not the size.
Note that the -
code path is never tested. You might wish to let them know about the lack of tests and docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With