0

When I commit a git lfs tracked file (without pushing) two things happen, as far as I understand:

  1. The file is copied to the local lfs object storage (.git/lfs/objects)
  2. The file is replaced with an lfs pointer file in the commit, but not in the working copy.

Under what circumstances can the file disappear from the local lfs object storage?

Since the branch has not been pushed yet, not even git prune should be able to delete local lfs objects according to the manual.

Yet, I keep running into issues with not being able to check out some branches, because of missing lfs objects. The error message refers to the objects not being on the server, but the branch has not been pushed anyway.

Rowan Archer
  • 103
  • 1
  • 6
Jawap
  • 2,463
  • 3
  • 28
  • 46

1 Answers1

0

I have seen this issue before when one of our team was using SourceTree. The LFS integration seemed to fail sometimes meaning that it was necessary to call the CLI to get it to push files to LFS.

The LFS server we used was also really flaky, so in the case where you can't pull a branch because of missing LFS objects, ensure the server is running and that you could ask the person that was working on that branch to perfors a CLI git-lfs push to attempt to resolve it.

Rowan Archer
  • 103
  • 1
  • 6
  • But I'm not even considering yet issues about syncing with a remote and other users. This is all local changes. The file was added to the local working copy, a commit has been made locally and now this commit cannot be checked out anymore. No pushing or pulling are involved. – Jawap Feb 13 '19 at 13:00
  • Does your version of git-lfs match the repository? Is the repository setup for lfs? This answer has some solutions for tracking issues with LFS: https://stackoverflow.com/a/35518689/10983456 – Rowan Archer Feb 13 '19 at 13:21