-1

If I delete from my Git repo a file that is stored on LFS, commit and then try to rebase my branch on the master, Git will see this file as modified during the rebase. If I revert the file doing git checkout -- mybigfile then git status will still list this file as modified and I am kind of stuck. The only thing I can do is to commit the file and pray I will not have to rebase until my commits are pushed.

My git configuration is:

core.autocrlf=true
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f

and my version is 2.17.1.windows.2.

How do you force Git to really revert a file stored on LFS or stop Git from seeing the file as modified ?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Fabien
  • 549
  • 7
  • 22

1 Answers1

2

Here is the workaround I found, inspired by this bug report:

cp /dev/null .gitattributes
git checkout -- mybigfile
git checkout -- .gitattributes
Fabien
  • 549
  • 7
  • 22