0

I have a repo that has LFS objects in it. However, I don't care about these LFS objects for my particular use-case. I just want to operate on the git repo like a normal repo with LFS objects remaining as text pointers. Is this possible? I keep running into things like:

$ git reset --hard origin/master
git-lfs filter-process: line 1: git-lfs: command not found
fatal: the remote end hung up unexpectedly

I don't understand what's going on because I don't even have git lfs installed nor do I want to install it. Git should not have knowledge of LFS yet somehow it does and is crashing. What's the point of LFS being a 3rd party extension if vanilla git also has some LFS checks baked in?

Edit: With GIT_TRACE=1, I get:

$ git reset --hard origin/master
11:53:42.431221 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
11:53:42.440223 git.c:460               trace: built-in: git reset --hard origin/master
11:53:43.237223 run-command.c:655       trace: run_command: 'git-lfs filter-process'

Edit2: I got it working with the following configs in my .gitconfig:

[filter "lfs"]
    process =
    required = false

You can set these configs at the global or repo level with i.e. git config --global filter.lfs.process ""

Gillespie
  • 5,780
  • 3
  • 32
  • 54
  • How did you clone the repository? Did your device have LFS installed at that point? Are there any files in `.git/hooks`? – dan1st Feb 07 '23 at 18:49
  • The repository was previously cloned months ago, and teammates recently started using LFS to commit blobs unrelated to my work. The only thing in `.git/hooks` is `*.sample` files – Gillespie Feb 07 '23 at 18:51
  • 1
    You might want to take a look at [that](https://stackoverflow.com/q/42019529/10871900) or alternatively [this answer](https://stackoverflow.com/a/73299246/10871900) suggesting `git config --global --remove-section filter.lfs`. – dan1st Feb 07 '23 at 18:54
  • Thanks. I tried removing the section from global config but that didn't seem to help. I guess re-cloning is my only option. I wish I knew what the trigger was that is causing git to attempt to run `git-lfs filter-process` – Gillespie Feb 07 '23 at 19:16
  • Maybe git lfs was once installed and then (incorrectly) uninstalled on that device/repository. – dan1st Feb 07 '23 at 19:17
  • The suggestion to modify settings in `filter.lfs` section of git config was a good one. Using a certain LLM that shall not be named here I was able to figure out which configs were needed to disable `git-lfs filter-process` and I amended my question with an edit. – Gillespie Feb 07 '23 at 19:32
  • 1
    Please don't edit your question with the answer. Instead write an answer in the `Your Answer` box below. See [Ask questions, get answers, no distractions](/tour) – dan1st Feb 07 '23 at 20:02

1 Answers1

0

I got it working with the following configs in my .gitconfig:

[filter "lfs"]
    process =
    required = false

You can set these configs at the global or repo level with i.e. git config --global filter.lfs.process ""

Gillespie
  • 5,780
  • 3
  • 32
  • 54