0

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?

  • Does this answer your question? [How can I undo pushed commits using git?](https://stackoverflow.com/questions/22682870/how-can-i-undo-pushed-commits-using-git) – Azucena H Oct 24 '22 at 22:51
  • @AzucenaH No, but it is good information. I'll probably need that at some point in the future lol. thank you much for the link. – Nicholas Davis Oct 25 '22 at 01:39

1 Answers1

0

GitHub documents the process quite clearly.

Basic steps:

  1. Rebase your changes and remove the offending commit from your local history.
  2. Force push the rebased changes to GitHub.
  3. Contact support to have the offending commit purged from pull requests, caches and issues it might be linked to.
jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • I believe this is the answer. I will try this method and mark this as the answer upon completion. Thank you for your answer. – Nicholas Davis Oct 25 '22 at 01:40