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 a Partial Clone That Silently Fails to Show a File’s Full History Because –filter Excluded Its Old Blobs

- 21.10.26 - ErcanOPAK

🔀 The File History That Stops Partway Back

A partial clone made with –filter=blob:none or –filter=blob:limit=<size> deliberately skips downloading most file content upfront to make cloning a large repository fast, fetching individual blobs lazily on demand as they’re actually needed – but git log on an older file, or a diff against a commit from before the clone’s own fetch depth, can need a blob that was deliberately filtered out and was never lazily fetched because the specific command being run didn’t trigger an automatic fetch for it, leaving history that looks like it simply stops, with no explicit error pointing at the real cause.

🔎 The Problem

git clone --filter=blob:none --no-checkout <url> big-repo
cd big-repo
git checkout main

git log --follow -- src/legacy/old-module.js
# Shows recent commits fine, then abruptly produces no further
# output or a vague "fatal: unable to read blob object" partway
# back in history, instead of continuing to the file's actual
# origin

What's actually happening: --filter=blob:none intentionally skips
downloading blob content during the initial clone, fetching each
blob lazily only when a command that needs its actual CONTENT asks
for it (checkout, diff, show). Some history-walking operations
instead reference blob object IDs purely for comparison or
traversal purposes without triggering that lazy content fetch for
every single one encountered - and if the remote's reachability
rules or an interrupted connection ever leave one of those blobs
genuinely unfetchable, the walk simply stops at that point with an
error that names a missing object, not an obviously filter-related
cause.

✅ Fix: Fetch the Missing Blobs Explicitly, Don’t Fight the Filter

  • Run git log with –no-walk=unsorted combined with explicit object IDs, or simpler, just run git fetch –filter=blob:none origin <specific old commit SHA> first to force the missing objects to actually be fetched, before retrying the git log –follow command that failed on them the first time.
  • For a specific file whose full history matters enough to look at repeatedly, use git backfill (in newer Git versions) or a manual git rev-list | xargs git cat-file to proactively hydrate every blob the file has ever had, rather than relying on each individual Git command to lazily fetch exactly what it happens to need on demand.
  • If full deep-history access for a subset of files is a frequent, ongoing need rather than a one-off lookup, reconsider –filter=blob:limit=<size> (which still fetches every blob under the given size eagerly) over –filter=blob:none for that repository, trading away some of the clone-speed benefit specifically for files that are small enough that filtering them was never saving much anyway.

🚨 Why This Is Dangerous

  • The error that surfaces (a generic ‘missing blob’ or an abrupt silent stop) gives no indication the real cause is the clone’s own filter settings from however long ago the repository was originally cloned – a developer debugging this reasonably assumes repository corruption or a network problem, not a configuration choice made once at clone time and since forgotten.
  • This specifically tends to surface for whoever is the first person on a team to go looking at genuinely old history – most day-to-day work only ever touches recent commits the partial clone already has cached locally, so the gap in older blob availability can go completely unnoticed for a long time after the partial clone was first set up.

A partial clone didn’t skip your repository’s history – it only ever promised to fetch it lazily, and the moment a command asks for an old blob in a way that lazy fetch doesn’t anticipate, the history that’s actually still there looks exactly like history that was never kept.

— Version Control Tip

Related posts:

Git: Fix a Commit History Where the Author Date Is Right but the Committer Date Gives Away the Real ...

Git: Fix a Commit History Where the Author Date Is Right but the Committer Date Gives Away the Real ...

Git History Loses Meaning

Git History Loses Meaning

Git: Fix a .gitignore Rule That's Ignored Because the File Was Already Tracked

Git: Fix a .gitignore Rule That's Ignored Because the File Was Already Tracked

Views: 7

Post navigation

CSS: Fix a Sticky Header That Silently Stops Sticking Partway Down the Page Because an Ancestor’s Overflow Isn’t Set to Visible
WordPress: Fix the REST API Silently Dropping Custom Meta Fields Because They Were Never Registered With show_in_rest

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 (977)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (854)
  • 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 @ (609)
  • 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 (547)
  • 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 (977)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (854)

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