Search code examples
eclipsegitegitgit-lfs

Why is egit with LFS showing "The system cannot find the file"?


Using Eclipse with egit. Recently added LFS. Any push to remote gives an error.

As a simple test case: I cloned a remote repository, then, without changing any files, pushed to a new branch on remote, and got this:

Can't connect to any URI... (Rejected by "pre-push" hook. 
open d:\dev\workspace\src\com\freightos\TestExcel.xlsx:
The system cannot find  the file specified.

Note that:

  • In the command line, pushing works

  • egit is invoking LFS. I know this because LFS pulled some large files, but also because uninstalling LFS produces a different error message.

  • The mentioned large file is indeed not present in this branch. It did exist in other branches, which were not involved in the above git workflow.


Solution

  • After running git lfs fetch --all, the problem is resolved. It fetches the old files not in the present branch.

    $ git lfs fetch --all
    Scanning for all objects ever referenced...
    * 740 objects found
    Fetching objects...
    Git LFS: (498 of 498 files) 2.07 GB / 2.01 GB