Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Git

Git: Fix a Git LFS-Tracked File That Clones as a Tiny Pointer Instead of the Real Binary

- 04.10.26 - ErcanOPAK

🔀 The Clone That Downloaded a Text File Pretending to Be Your Binary

Large File Storage replaces tracked binary files with small text pointer files inside the actual repository history, and relies on a separate filter configured per machine to swap those pointers back for the real content on checkout. Clone the repository with a tool, a CI image, or a minimal installation that never had that filter configured, and the checkout produces exactly the pointer files as stored in history – small, valid-looking text files with the wrong extension, that open as garbled text instead of the real image, video, or binary asset they are meant to represent.

🔎 The Problem

$ git clone https://example.com/repo.git
$ cat assets/hero-banner.psd
version https://git-lfs.github.com/spec/v1
oid sha256:4d7a9c3b1e...
size 48213920

# That is the entire file on disk - 130 bytes, not the 48 MB file it
# is supposed to be. Opening it anywhere fails or shows garbage,
# because there is no binary content here yet, just the pointer the
# filter was supposed to resolve on checkout.

# The fix starts with registering the filter ONCE per machine, then
# re-pulling to replace the pointers with real content:
$ git lfs install
$ git lfs pull

✅ Fix: Install the Filter Once Per Machine, Then Re-Pull

  • Run the install step once on every machine or CI image that will clone a repository using Large File Storage – it registers the checkout filter Git needs to resolve pointer files into real content, and a fresh operating system image or container almost never has it unless you add it explicitly.
  • On a machine that already has an affected clone, re-pull the tracked content after installing the filter instead of re-cloning the whole repository – it resolves the existing pointer files in place without needing to download everything again.
  • For CI pipelines specifically, confirm the checkout step actually fetches the tracked content, since many checkout actions have that support turned off by default – a build that silently operates on pointer files instead of real assets can pass by accident on tests that never actually open the file.

⚠️ Why This Is Easy to Miss

  • A pointer file is a syntactically valid, small text file – nothing about the clone itself errors or warns you, so the problem only becomes visible once something downstream actually tries to open or process the file’s real content.
  • A developer’s own laptop usually has the filter installed once, globally, from whenever they first set it up, so the gap in a fresh CI image or a new teammate’s machine is easy to overlook as something that has never been a problem before.

A pointer file is a perfectly honest description of where your binary is supposed to come from – it is just not, itself, the binary.

— Version Control Tip

Related posts:

Git: Choose the Right Git Workflow

Git: Choose the Right Git Workflow

Git: Fix Line Ending Warnings That Mark Every File as Changed After a Fresh Clone

Git: Fix Line Ending Warnings That Mark Every File as Changed After a Fresh Clone

Git: Fix the Same Merge Conflict You Keep Resolving Over and Over Because rerere Was Never Turned On

Git: Fix the Same Merge Conflict You Keep Resolving Over and Over Because rerere Was Never Turned On

Views: 17
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

Photoshop: Fix the History Panel Running Out of Undo States Mid-Edit Because of One Setting Buried in Preferences
Windows 11: Fix Windows Hello Face Recognition That Stops Working Right After a Windows Update

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Read

  1. 01How to make theater mode the default for Youtube 1,079 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 997 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 996 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 873 views
  5. 05How to select distinct rows in a datatable in C# 868 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 671 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 631 views
  8. 08Average of all values in a column that are not zero in SQL 584 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 562 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com