Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

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 Large Files Checking Out as Tiny Text Pointers Because Git LFS Was Never Installed on That Machine

- 14.11.26 - ErcanOPAK

🔀 Fix Large Files Checking Out as Tiny Text Pointers Because Git LFS Was Never Installed on That Machine

Git LFS works by replacing a large tracked file’s actual content in the repository with a small text pointer file containing an object ID and a byte size, and relying on a Git LFS client hook installed locally to transparently swap that pointer back out for the real binary content during checkout. On a machine where the git-lfs client was never installed, a fresh CI runner, a teammate’s new laptop, a Docker build stage that only installed git itself, git has no idea LFS pointers mean anything special; it checks out the pointer file exactly as committed, so a multi-megabyte asset shows up as a tiny, human-readable text file a few hundred bytes long instead of the real content.

🔎 The Problem

$ cat assets/hero-video.mp4
version https://git-lfs.github.com/spec/v1
oid sha256:4d7a214614ab2935c943f9e0ff69a...
size 48213890

$ ls -la assets/hero-video.mp4
-rw-r--r-- 1 user user 134 Nov 14 10:02 assets/hero-video.mp4
# 134 bytes - that's the pointer file, not the real ~48MB video

✅ Fix: Install the LFS Client and Re-Checkout

  • Install git-lfs on the machine before cloning or checking out a repository that uses LFS-tracked files, not after discovering pointer files are checked out, since git lfs install sets up the required smudge and clean filters.
  • If the pointer files are already checked out, run git lfs pull after installing the client to replace the pointer text with the real binary content without needing a fresh clone.
  • Add a git-lfs install step explicitly to CI and Docker build pipelines rather than assuming whatever base image or runner is used already has it; a plain git clone in a minimal image will not fetch real LFS content.

🚨 Why This Is Dangerous

  • A build or deployment pipeline that silently ships the pointer text instead of the real asset doesn’t fail loudly; it produces a working-looking build with a broken video, image, or binary that only surfaces when someone actually opens it.

Git LFS keeps your repository small by handing you a promise instead of the file — and a machine without the LFS client never redeems that promise.

— Version Control Tip

Related posts:

Git: Ignoring Local Changes to Tracked Files (Config Protection)

Git: Ignoring Local Changes to Tracked Files (Config Protection)

Git: Fix a git mv Rename That Silently Shows Up as a Delete-and-Add Because the File Changed Too Muc...

Git: Fix a git mv Rename That Silently Shows Up as a Delete-and-Add Because the File Changed Too Muc...

Git: Fix a Confusing Diff That Shows an Entire Function as Changed Because the Default Diff Algorith...

Git: Fix a Confusing Diff That Shows an Entire Function as Changed Because the Default Diff Algorith...

Views: 5

Post navigation

The AI Prompt That Explains Exactly Why a Query Plan Picked a Nested Loop Join Instead of a Hash Join
C#: Fix a yield return Iterator Delaying Its Own Argument-Validation Exception Until the First Call to MoveNext Instead of at Invocation

Leave a Reply Cancel reply

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

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

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

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (976)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (852)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

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