HOW-TO GUIDE

How to find duplicate files in a GitHub repo

Repeated filenames hide in plain sight across large repositories — GitHub's folder-by-folder view gives you no way to notice them without checking every directory by hand. Here's a faster way.

Why this is hard to spot manually

To manually find every place a filename like config.ts appears in a large repository, you'd need to either remember every folder you've opened and cross-reference by hand, or use GitHub's search with a filename: qualifier and page through results — workable, but slow, and easy to miss instances in folders you haven't thought to check.

Install RepoKit

Add it to Chrome from the Chrome Web Store — free, instant setup.

Open the repository

RepoKit indexes the full tree automatically as the page loads.

Look for numbered badges next to filenames

Any file whose name repeats elsewhere in the repo shows a small ×2, ×3, etc. badge right in the listing.

Click a badge to see every location

A focused list opens showing every other path sharing that filename, so you can jump between them directly.
A second path: search

If you already suspect a specific filename might be duplicated, searching for it with RepoKit's Ctrl/Cmd+Shift+K search shows every matching path at once — a quicker route than waiting to spot a badge if you know what you're looking for.

What to do once you've found duplicates

Not every duplicate is a problem — monorepos legitimately reuse filenames like index.ts or README.md per package, and that's expected structure, not an issue. The value of surfacing them is giving you the choice: confirm the repetition is intentional, or catch the genuine accidents — a leftover copy, a build artifact committed alongside its source — before they cause confusion for the next person who opens the repo.

Frequently asked questions

Does this detect duplicate content, or just duplicate names?+
Duplicate filenames, not byte-identical content. Two files with the same name are flagged even if their contents differ — which, in practice, is usually the more actionable signal, since a repeated name is worth a human look regardless of whether it turns out to be intentional.
Is this useful for anything besides cleanup?+
Yes — it's also a fast way to understand a monorepo's structure (seeing that every package has its own package.json and README.md is expected and informative), not just a tool for finding mistakes.
Can I export a list of all duplicates in a repo?+
RepoKit surfaces duplicates inline as you browse and search rather than as a standalone exported report — for a full repo-wide audit, searching a suspected common filename (like index.ts) and reviewing every flagged instance is the fastest path today.
Keep exploring

Related pages

Catch duplicate filenames across any repo instantly.

RepoKit flags every repeated filename automatically as you browse.

Add RepoKit to Chrome — it's free
Free · No account required · Works instantly on github.com