Rizhiy
Rizhiy

Reputation: 854

git lfs "Could not check out <file>"

I'm trying to clone a repository which uses git-lfs. Although main clone went fine, when I try to run git lfs pull some of the files are not updated and it prints error of form:

Could not checkout out "path/to/file"

What could be the problem?

All of the files which are not downloaded have been locked before.

Upvotes: 1

Views: 3400

Answers (2)

PHZ.fi-Pharazon
PHZ.fi-Pharazon

Reputation: 2121

To unlock git lfs locked files use command

git lfs unlock <filename>

You can also use the following command on Linux & Mac on terminal

cd to_the_project_dir
chmod -R u+rw .

On Windows, you can open File Explorer, and right-click the project folder → Properties, and uncheck "Read-Only". Apply it to all subfolders.

If you have TortoiseGit, you can LFS Unlock it by TortoiseGit → LFS → Lock.

See https://tortoisegit.org/docs/tortoisegit/tgit-dug-lfslocking.html

Upvotes: 0

Rizhiy
Rizhiy

Reputation: 854

Turns out that since files were lockable git-lfs couldn't change them since they are cloned as locked.

To fix just unlock them (add user write permission).

Upvotes: 2

Related Questions