Accidentally Committed Sensitive Data #184902
Replies: 2 comments
-
|
It is possible. Here are a few steps I used once (I think this is right someone correct me if I'm wrong):
Warning Anyone who cloned the repo before this will still have all the old commits with the secret. They'll need to re-clone or reset their branches (which I can help with) to match the newer history. If the repo is public please rotate the secrets as I don't want anyone to have noticed and/or copied them. If it's private it should mostly be fine. Someone tell me if this is wrong. This is basically a reword of a random |
Beta Was this translation helpful? Give feedback.
-
|
Hey Ganesh! No worries — this happens more often than you’d think. Even if you removed the API key in a later commit, it still exists in your repo’s git history, which means it can be recovered unless you clean it properly. 🧼 Step 1: Use git filter-repo (Recommended)
🧯 Step 2: Revoke the Leaked Key Immediately 🧹 Step 3: Clear GitHub Cache (Optional) 🛡️ Pro Tip for the Future
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion Type
General
Discussion Content
Hey Im Ganesh form Gasco Inc I accidentally committed an API key to my GitHub repository. I removed it in a later commit, but I’m worried it’s still accessible in the commit history. What is the correct way to completely remove sensitive data from GitHub?
Beta Was this translation helpful? Give feedback.
All reactions