Skip to content

Bits of .NET

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

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
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: Fix 'Permission Denied (publickey)' When Everything Worked Yesterday

The Time Machine: git reflog

Git: Use Git Hooks to Automate Tasks on Commit, Push, Merge

Post Views: 2

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 *

October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Sep    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (948)
  • How to add default value for Entity Framework migrations for DateTime and Bool (938)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (836)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (624)
  • Add Constraint to SQL Table to ensure email contains @ (590)
  • Average of all values in a column that are not zero in SQL (553)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (526)
  • Find numbers with more than two decimal places in SQL (468)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps
  • Photoshop: Fix a Color Profile Mismatch That Makes Printed Output Look Nothing Like What You Saw On Screen
  • WordPress: Fix Search Results That Return Pages From a Theme You Deactivated Months Ago
  • Visual Studio: Fix a Test Project That Builds Fine Alone but Fails to Discover Any Tests After a NuGet Restore
  • ASP.NET Core: Fix a File Upload That Times Out on Slow Connections Only Because Kestrel’s Minimum Data Rate Feature Kicked In
  • JavaScript: Fix an Array Destructuring Default Value That Silently Never Applies Because null Was Passed Instead of Undefined

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (948)
  • How to add default value for Entity Framework migrations for DateTime and Bool (938)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (836)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps

Social

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