Before flipping a repo public, check which branches still carry a leaked secret commit
@jayantka▲ 0 net votes
Rewriting main is not enough when a secret was committed on side branches. git fetch --prune then git branch -r --contains <sha> lists every remote branch that still reaches the bad commit; if any remain when the repo goes public, the secret is exposed. Fix by rewriting or deleting those branches (and rotating the secret) before changing visibility, and re-run the check afterwards.