I recently pushed a commit to GitHub that I shouldn't have, which could have contained sensitive information. Thankfully it didn't. I immediately deleted the file in question and quickly noticed that I and anyone with access to this repo can see the contents of the uploaded file if they click on the commit history and load diff
. Is there any way to delete the contents of that commit so that it no longer shows up in my repository commit history?
CodePudding user response:
GitHub documents the process quite clearly.
Basic steps:
- Rebase your changes and remove the offending commit from your local history.
- Force push the rebased changes to GitHub.
- Contact support to have the offending commit purged from pull requests, caches and issues it might be linked to.