Git · Junior · Question 47 of 75
You accidentally committed an API key and pushed it. What must you do first?
- 1Make the repository private for a few days
- ✓Correct answer: Revoke and rotate the key, then clean it out of history
- 3Delete the file in a new commit and push again
Explanation
Once pushed, assume it's compromised: bots scan public repositories within minutes. A new commit doesn't remove the key from history, and rewriting history doesn't help clones others already have.