What happened
We publish small macOS apps. Each one has two repositories: a private one with the source code and a public one with the README, screenshots and downloads. The source is not meant to be public.
For two of the apps, the public repository did not start out as a public companion. It started as the working repository. The source code was committed there on 17 April 2026 and removed a few days later by an ordinary commit: in one repository that commit deleted 52 files and 3,010 lines. From that day the main branch looked exactly as intended. No source files, only the README and images.
The history kept everything. Anyone who cloned the repository and looked at the first commits got the full source. A README screenshot in the same history also showed personal email addresses.
We found it on 16 November 2026, while reviewing what our public repositories show before linking them from this site. Nobody reported it. The repositories had no forks and no stars, so the realistic exposure is small. It is still seven months of source code that was one git log away.
The fix that looks complete
We did what most guides describe:
- Made a full mirror backup of each repository.
- Rewrote the history with
git filter-repo, dropping the source files and old screenshots from every commit. - Force-pushed all branches and all tags.
One repository went from 30 commits to 16, the other from 24 to 12. A fresh clone contained no source code in any commit. Releases and download links kept working. By every check you can run with git on a clone, the data was gone.
What we tested the next day
We kept the ID of the old commit that first added the source code and tried to reach it from outside, without logging in. All of this is public behaviour of the platform, tested on our own repository.
| Test | Result |
|---|---|
| Commit page by full ID | opens, shows the diff |
| Commit page by the first seven characters of the ID | opens |
| Raw file at that commit | downloads |
| REST API, commit by ID | returns the commit |
git fetch of that ID into an empty repository | fetches the tree with 27 Swift files |
The last line matters most. It is not a cached web page. The server hands the removed objects to any git client that asks for them by ID.
Why the data is still there
A force-push moves branch and tag names to new commits. It does not delete the old commits. They stay in the repository's storage as objects that no name points to, and GitHub keeps serving them by ID. GitHub's own guide on removing sensitive data says the same: after a rewrite the data may still be reachable in clones and forks, by commit ID in cached views, and through pull requests that reference it. Removing it for good takes a request to GitHub Support, who run garbage collection on the server and remove the cached views.
But who knows the commit ID?
This is the usual objection, and it does not hold.
- The repository's public event feed. The day after our force-push, the feed of one repository still listed a commit ID from the old history. Every commit links to its parents, so one old ID is enough to walk back to the commit that added the source.
- Public archives of GitHub events. Push events of public repositories are recorded by third parties and kept. An ID that was public once stays findable.
- Short IDs. GitHub accepts abbreviated commit IDs. Truffle Security showed in 2024 that in a small repository short IDs can simply be tried one after another.
- Anyone who already has a clone. Their copy contains the old commits and their IDs.
How to check your own repository
1. See what has ever been in the history
The current files say nothing about the past. List every path that ever existed:
git log --all --name-only --pretty=format: | sort -u
And everything that was deleted at some point:
git log --all --diff-filter=D --name-only --pretty=format: | sort -u
Look for source code that should be private, configuration files, database dumps, keys and screenshots.
2. Scan the history for credentials
Run a secret scanner such as gitleaks or TruffleHog over the full history, not only the current files. We ran a pattern scan over the old history of both repositories and found no keys or tokens. That is why our case is about source code and email addresses and not about an incident with credentials.
3. After a rewrite, test from outside
Before you rewrite anything, write down the ID of one commit that contains the data. After the force-push, from a machine where you are not logged in:
curl -s -o /dev/null -w "%{http_code}\n" https://github.com/OWNER/REPO/commit/OLD_ID
mkdir check && cd check && git init -q
git fetch --depth 1 https://github.com/OWNER/REPO.git OLD_ID
If the first command prints 200 or the fetch succeeds, the data is still published.
What actually removes it
- If it is a credential, revoke it first. A key that was public must be treated as used by someone else. Rotation is the fix. History cleaning is housekeeping.
- Rewrite the history with
git filter-repoand force-push every branch and every tag. One forgotten tag keeps the whole old history alive. - Check forks and pull requests. A fork keeps its own copy and only its owner can remove it. Pull requests keep references that you cannot delete yourself.
- Ask GitHub Support to remove the unreachable commits and cached views. Give them the repository and the old commit IDs. Note the condition in GitHub's guide: Support helps only with sensitive data whose risk cannot be removed by rotating a credential.
- Tell everyone with a clone to clone again. A normal
git pullfollowed by a push brings the old history back. - Run the outside test again and keep the result.
What we did in the end
We took a blunter route than a support request. Both repositories had no forks, no stars, no issues and no pull requests, so nothing of value lived outside the history itself. We made a full backup of the cleaned history and of every release, deleted both repositories and created them again under the same names from that backup.
The price was small for us and would not be for a popular project: download counters went back to zero, release dates changed to the day of the restore, and the links were down for a few minutes. Stars, issues and pull requests would have been lost as well, and a fork would have kept its own copy no matter what we did.
Then we ran the outside test again. The old commit IDs return “not found” on the web and through the API, and git fetch by the old ID is refused. Only then did we publish this article.
What we changed
- A public repository starts empty. We no longer turn a working repository into a public one by deleting files. The public repository is created new, and files are copied into it.
- History is part of the review. Before a repository becomes public, we list every path that ever existed in it, not only the current tree.
- Screenshots are reviewed like code. Ours showed email addresses that no secret scanner would flag.
- “Deleted” is tested from outside. A clean clone proves nothing about what the server still serves.
When an outside review makes sense
If your product's repositories were ever public, or will become public as part of a sale, an open-source release or a due diligence, it is worth having someone other than the authors go through the history before that date. It is a short job, and it is much cheaper before publication than after.