A man reviews a digital data workflow dashboard on a large monitor in a modern office.
Every software team eventually hits that mysterious morning when a routine git clone stops feeling like a quick coffee-break command and starts feeling like downloading an uncompressed ISO over hotel Wi-Fi. Nothing obvious broke overnight, nobody intentionally sabotaged the build server, yet everyday fetch, clone, and web-browsing operations suddenly crawl. On November 23, 2026, Microsoft Software Engineer II Artur Karachev took to the Azure DevOps Blog to highlight a fresh set of official troubleshooting and prevention instructions aimed squarely at that slow-motion drift: Optimize repository performance for Azure Repos.

Rather than announcing a new feature flag or a server-side miracle cure, Microsoft is handing DevOps admins and Windows developers a structured playbook—originally added to Microsoft Learn in late August 2026 and covering Azure DevOps Services, Azure DevOps Server, and Azure DevOps Server 2022. The timing matters. As repositories absorb generated artifacts, AI-assisted code churn, and years of forgotten feature branches, teams often reach for the wrong remedy—like deleting a branch and assuming the problem vanished from the server. As Microsoft’s documentation makes bluntly clear, Git bloat in Azure Repos is far easier to prevent than to erase.

A man reviews a digital data workflow dashboard on a large monitor in a modern office. Why “Harmless” Commits Quietly Wreck Git Performance​

Git was engineered to shine on classic source code: relatively small text files, localized edits, and tidy directory hierarchies. Under those conditions, Git’s delta compression—storing compact differences between versions rather than duplicating entire files—keeps packfiles lean and tree traversals snappy. Break those assumptions, and Git starts lugging around massive objects on every clone and fetch.

Karachev’s announcement and the accompanying Microsoft Learn guide spotlight three deceptively ordinary habits that derail repositories:

  • Checking in binaries and volatile large files: Binaries rarely resemble their previous versions byte-for-byte, and huge text files that get rewritten from top to bottom suffer the exact same fate. When delta compression fails, Git ends up storing nearly a complete snapshot on every single commit, causing repository size and object counts to spike rapidly.
  • Shuffling generated text files: Even small updates to generated files—such as lockfiles, manifests, or automated exports—can turn into bloated diffs if records aren’t emitted in a consistent sort order. Reordering lines forces Git to record far more change data than the actual edit warranted.
  • Ignoring the reach of unmerged branches: Running git clone pulls objects reachable from every branch on the remote server by default, not just main. If one developer pushes a multi-hundred-megabyte test asset to an experimental branch and never merges it, every teammate cloning the repository still pays the bandwidth and disk tax.

Doesn't it seem unfair that someone else’s abandoned spike branch from two quarters ago can still slow down your CI runner today? That is Git’s reachability model working exactly as designed—which is why repository hygiene has to be intentional.

Step 1: Diagnose Before You Prescribe​

Before moving files around or lecturing developers in Slack, Microsoft recommends measuring what is actually happening inside the repository. Guessing whether your bottleneck is giant blobs, sprawling directories, or ref bloat is a great way to waste a sprint.

Start in the Browser with Health and Usage​

Your first stop requires zero command-line setup. In the Azure DevOps web portal, open your repository, navigate to Repo > Files, and click Health and usage from the ellipsis (More actions) menu. The Repository health and usage panel surfaces overall size, object counts, and reference counts, flagging metrics approaching recommended limits in amber and unhealthy values in red.

One version caveat applies for on-premises shops: older releases of Azure DevOps Server may not include the Health and usage panel, in which case Microsoft advises upgrading to access those built-in metrics.

Dig Deeper with Full-Clone CLI Tools​

When the web summary tells you that a repository is unhealthy without telling you where the weight lives, Microsoft points maintainers toward three command-line analyzers. Importantly, all three must be run against a full clone of the repository—meaning this is diagnostic work for a maintainer who can afford the initial download, not a zero-bandwidth trick.

Diagnostic ToolBest Use CaseKey Output & Platform Notes
git-sizerHigh-level health auditEvaluates repository-wide size and complexity and assigns concern levels to each metric.
git repo structureNative Git alternativeExperimental mainstream Git command designed to deliver git-sizer-style metrics natively.
git surveyPinpointing exact offendersRanks top directories and files by object count, on-disk size, and inflated size; included in Git for Windows and Microsoft’s Git fork (availability varies elsewhere).

Microsoft’s smartest diagnostic tip is simple: don’t treat these tools as a one-off panic button. Running them periodically and comparing snapshots over time reveals growth curves early, long before developers start filing IT tickets about clone timeouts.

Section takeaway: Start with the Azure Repos Health and usage panel for fast red/amber alerts, then use git-sizer, git repo structure, or git survey on a full clone to isolate the exact paths or object types driving bloat.

Step 2: Fix the Structural Culprits and Block New Bloat​

Once diagnostics tell you what is inflating your repo, Microsoft’s guidance breaks remediation into three targeted areas—plus a few critical guardrails from Azure Repos’ existing repository-settings and limits documentation.

Keep Large, Volatile Files Out of Git (and Use LFS Correctly)​

Whether a file is binary or plain text, large assets that change frequently belong outside standard Git history. Microsoft recommends offloading them to Git LFS or Azure Artifacts, and keeping build outputs and generated artifacts out of source control altogether. If a large, frequently modified file genuinely belongs in Git, break it into smaller logical files that can be versioned independently.

Crucially, Microsoft warns against treating Git LFS as a blanket cure-all: only use Git LFS for large files that do not diff well. Shoving thousands of tiny files into LFS does not speed anything up and can actually degrade performance.

To keep future accidents from slipping through, administrators should enable Azure Repos’ Maximum file size policy:

  1. In your browser, open Project Settings > Repositories.
  2. Choose All Repositories (to set project-wide defaults) or select an individual repository under the Repositories tab.
  3. Open the Policies tab, switch Maximum file size to On, and select a threshold. (Admins automating governance can also configure this via Azure CLI with az repos policy file-size create or update.)

Keep two operational nuances in mind. First, Microsoft advises configuring repository settings at either the project level or the individual repository level, not both—if settings collide across scopes, Azure Repos enforces the most restrictive rule, which can cause confusion. Second, when a push triggers the Maximum file size policy, it is blocked immediately; the developer has to rewrite their unpushed local history to strip out the oversized file before retrying. For broader context, Microsoft’s separate Git limits guidance recommends keeping individual files under 100 MB and total repository size below 10 GB for optimal day-to-day performance (alongside hard service ceilings of 250 GB per repository and 5 GB per push, excluding LFS objects).

Rebalance Flat Directories and Stabilize Generated Output​

Few developers think twice about dumping generated files into a single folder—until Git has to version it. In Git’s internal model, a directory containing hundreds or thousands of direct files and subdirectories is stored as a single oversized tree object. Touch one file inside that directory, and Git has to write a brand-new copy of the entire tree object.

Microsoft suggests watching for any single directory climbing above a few hundred direct entries—not as a hard platform cutoff, but as an early warning to rebalance the folder hierarchy. For example, Microsoft engineer Jonathan Creamer previously documented how Microsoft’s own sprawling “1JS” JavaScript monorepo ballooned to a 178 GB clone in part because up to 40,000 automated change files accumulated in a single folder.

Microsoft’s recommended fixes are straightforward:

  • Distribute files evenly into a balanced hierarchy so no single folder acts as a bottleneck.
  • Partition large volumes of generated files into nested paths such as year/month/day.
  • Sort generated text deterministically (for example, always sorting list items the same way) so minor additions only touch a handful of lines instead of shuffling the whole file.

Prune Stale Branches or Enable Limited Refs​

Because Git clones fetch objects reachable from every remote ref, long-lived, forgotten branches act like hidden luggage racks bolted onto every developer’s download. Pruning stale and merged branches on a regular cadence trims both reachable bloat and ref-negotiation overhead. For massive repositories that legitimately carry thousands of active branches—Microsoft’s Repository health documentation sets 10,000 refs as the threshold to watch—enabling Limited Refs reduces how many references clients and the server must negotiate on every fetch.

The Catch Nobody Wants to Hear: Azure Repos Is Append-Only​

Here is the single most important reality check in the new guidance, and the one most likely to save an IT team from a wasted weekend: Azure Repos storage on the server is append-only.

Everything described above—offloading binaries, splitting directories, pruning branches, and enforcing file-size policies—stops future runaway growth. It will not shrink a repository that is already bloated. Force-pushing rewritten history or deleting a branch does not reclaim space on Azure Repos’ backend, because previously committed objects remain on the server.

If an oversized repository has already crossed into painful territory and you truly must purge historical bloat, Microsoft states there is only one complete fix: create a fresh repository and migrate only the content you actually need. That is a sobering operational constraint, and a compelling argument for turning on Maximum file size policies before someone commits a 400 MB compiled SDK or dataset.

Step 3: Cut Client Bandwidth Today with Shallow and Partial Clones​

Even when a repository is completely healthy—or while you are planning a longer-term migration—clients don’t have to pull decades of history just to build a pull request. Microsoft highlights two client-side clone strategies:

  • Shallow clones (git clone --depth=1 <url>): Truncate commit history to only the latest commits. Shallow clones are blazingly fast for automated CI pipelines that just need to compile and test HEAD, though they are a poor fit for developers who need git blame, bisecting, or deep history locally.
  • Partial clones (--filter=blob:none or --filter=tree:0): Preserve the entire commit history while deferring file contents (blobless clones) or tree objects (treeless clones) until Git actually needs them at checkout. When Microsoft rolled out partial clone support across Azure DevOps, the company reported an average 88.6% reduction in clone times where adopted—and over 99% on the very largest repositories. Better yet, Azure Pipelines YAML checkout tasks also pair partial clone filters with git sparse-checkout so build agents only materialize the directories a pipeline cares about.

The bottom line for Windows and DevOps teams: Microsoft’s newly publicized Azure Repos guide isn’t selling magic—it’s codifying hard-won monorepo discipline. Check your repo’s Health and usage panel this week, run git survey from Git for Windows if metrics flash amber or red, lock down oversized pushes before append-only storage locks in your mistakes, and shift CI and developer machines onto partial or shallow clones wherever full downloads aren’t strictly necessary. Your build agents—and your team’s SSDs—will thank you.

 

References

  1. New guidance to optimize Git performance in Azure Repos Azure DevOps Blog 2026-11-23T18:00:44+00:00
  2. Optimize repository performance - Azure Repos | Microsoft Learn learn.microsoft.com
  3. Git limits - Azure Repos | Microsoft Learn learn.microsoft.com