Paolo Vigori
Paolo Vigori

Reputation: 1724

How can I remove invalid entries (or pointers) from a GIT reposiory that uses LFS?

We added some png to our git repository with git lfs. Somehow something went wrong and a couple of file have bad entries with slashes in the wrong way

data/images\\picture1.png
data/images\\picture2.png

The real files exists and work OK

data/images/picture1.png
data/images/picture2.png

Now if I pull, I get an error

$ git.exe pull --progress --no-rebase -v "origin"
From bitbucket.org:USER/REP
= [up to date]      master     -> origin/master
Pointer file error: Unable to parse pointer at: "data/images\\picture1.png"

I've tried alread git rm and gc but with no luck. Is there a way to delete those entries directly from git DB?

Issue is on Windows, Linux and Mac

EDIT

Running git ls-files, I can see the files in the list, something like

  data/images/picture0.png
  "data/images\\picture1.png"
  "data/images\\picture2.png"
  data/images/picture3.png

if I try git rm with all kind of flavours (quotes, no quote, --force, --cache, --dry-run), I always receved the error

fatal: pathspec '"data/images\\picture1.png"' did not match any files

Upvotes: 2

Views: 1579

Answers (1)

Paolo Vigori
Paolo Vigori

Reputation: 1724

We ended up recreating the respository from scratch and the problem went away by itself. It was probably due to one of many issues that currently affect git LFS..

Upvotes: 1

Related Questions