Skip to content

Files committed before their .gitattributes LFS rule enter an un-exitable "phantom modified" state that blocks pull/rebase #22748

Open

Description

@CatZAI-Patrick

The problem

Summary

When a file is committed to git as a raw blob and a .gitattributes LFS rule for its extension is added afterward, the file enters a permanent mismatch: git's clean filter now produces a 131-byte LFS pointer, but the index and HEAD still hold the raw blob. Git reports the file as modified. The file's content is completely unchanged — only the storage form differs.

Reproduction (deterministic)

  1. Commit a binary file with no matching LFS rule in .gitattributes (it goes in as a raw blob).
  2. Later, add a rule for that extension (e.g. *.png filter=lfs diff=lfs merge=lfs -text).
  3. Do not run git add --renormalize.
  4. Touch the file's mtime by any means (save, copy, tool pass — no content change required).
  5. git status now shows it modified, permanently.

Step 4 is the only reason this is intermittent rather than universal. Git skips the clean filter for files whose recorded stat data still matches, so thousands of affected files sit invisible until something moves an mtime. This is very common in our workflow, if you do a Pull while Unreal is open with locked files, it does a partial pull, and leaves the files in this orphaned state, and there's no solution for fixing it in the desktop app, you have to go do some magic via command line.

Release version

3.6.4

Operating system

Win 10

Steps to reproduce the behavior

Reproduction (deterministic)

  1. Commit a binary file with no matching LFS rule in .gitattributes (it goes in as a raw blob).
  2. Later, add a rule for that extension (e.g. *.png filter=lfs diff=lfs merge=lfs -text).
  3. Do not run git add --renormalize.
  4. Touch the file's mtime by any means (save, copy, tool pass — no content change required).
  5. git status now shows it modified, permanently.
  6. Attempt to discard, or accomplish anything, and you are stuck as none of it works.

Log files

No response

Screenshots

No response

Additional context

The other root problem here is that leaving a partial pull stranded because you hit a locked file is poor design. It should auto discard and rollback what it had accomplished when the locked file was encountered, not leave the user in a state primed to commit an evil merge if they don't understand they need to discard the partially pulled files. To a naive user it looks like you're deleting them from the depot to discard them.

Activity

  1. desktop-triage commented on Aug 18, 2026

    @desktop-triage

    Suggesting bug and priority-2 labels: the report gives deterministic repro steps showing that once a .gitattributes LFS rule is added after a file was already committed as a raw blob, git status permanently reports it as modified (LFS clean filter vs. raw blob in HEAD/index), and this blocks pull/discard/rebase in the app with no in-app fix. No duplicate issue was found in a search of desktop/desktop for related LFS renormalize/phantom-modified reports.

    Generated by Issue Triage (skills-driven) for #22748 · auto · 21.8 AIC · ⌖ 1.49 AIC · ⊞ 8.1K · ◷

  2. added
    bug
    priority-2
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions