Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git lfs (Large File Storage) says lfs managed files are modified after a git lfs pull

I have a working copy of a repository that uses git-lfs to store some large files. I have git-lfs binary installed, but may not have run "git lfs install" inside of the working copy. When I want to update my local working copy after additions of lfs files, I execute these commands:

git pull
git lfs pull

That worked fine as long as lfs files were being added. Then the repository had some lfs files that were modified and when I ran git pull I got the error message:

Your local changes to the following files would be overwritten by merge
....
....

And it listed out all of the lfs files that were going to be modified by the pull.

Since then, I ran git lfs install inside the working copy and it worked fine, but git status still lists all those files as being modified and a git pull gives me the same error.

My question is basically, what are the right steps for updating my working copy if I'm using lfs? How do I clean up this sticky situation?

like image 758
greggles Avatar asked Jan 08 '16 20:01

greggles


People also ask

How do I know if Git LFS is enabled?

If everything is set up correctly, you can verify that git LFS is going to work properly by: git add the file(s) in question. Do one of the following: Run git lfs status and ensure the file(s) in question appear under Git LFS objects to be committed , and that they have the LFS value in parenthesis; or.

What does Git LFS pull do?

Git LFS (Large File Storage) is a Git extension developed by Atlassian, GitHub, and a few other open source contributors, that reduces the impact of large files in your repository by downloading the relevant versions of them lazily.

Does Git LFS have a limit?

If you exceed the limit of 5GB, any new files added to the repository will be rejected silently by Git LFS.


1 Answers

Turns out that running git lfs install inside the working copy was half the solution. The second half was to run git reset inside of the working copy which:

  • left the large files in place
  • let git know that they were not actually dirty and were just fine

And now it seems that I no longer need to explicitly do the git lfs pull to get the latest large files. The first git pull works fine.

like image 160
greggles Avatar answered Oct 25 '22 20:10

greggles