🚨 Accidentally pushed a password, API key, token, or other secret to GitHub or GitLab?
Deleting the file and pushing another commit is NOT enough. The secret still exists in your Git commit history and can still be accessed from older commits.
In this video, you'll learn how to permanently remove secrets from Git history using git-filter-repo, the tool officially recommended by GitHub for rewriting repository history.
📌 What you'll learn:
Why deleting a file doesn't remove the secret
How to remove secrets from Git commit history
How to use `git-filter-repo --replace-text`
How to redact only the secret instead of deleting the entire file
Why `git remote -v` becomes empty after running `git-filter-repo`
How to add the remote back and safely force push the rewritten history
This tutorial works for both *GitHub* and *GitLab* repositories.
🛠️ *Tools Used*
Git
git-filter-repo
GitHub
GitLab
Sarvam AI (Text-to-Speech)
🎙️ *Voiceover*
The narration in this video was generated using *Sarvam AI* Text-to-Speech.
If you found this video helpful, please consider:
👍 Like the video
💬 Leave a comment if you have any questions
🔔 Subscribe for more Cyber Security, DFIR, Git, and DevSecOps tutorials.
#Git #GitHub #GitLab #GitFilterRepo #DevSecOps #CyberSecurity #Secrets #APIKeys #PasswordSecurity #Developers