0

I accidentally pushed a commit with sensitive data to Github. So I immediately deleted the branch that contained the commit (via Github UI). When I recloned the repo and run git show <hash>, I received fatal: bad object <hash>, so I know that commit is gone, but when I visited github.com/$account/$repository/commit/<hash>, I can still see the commit.

I saw this solution. https://help.github.com/articles/commit-exists-on-github-but-not-in-my-local-clone/ But I am unable to implement for my case because I no longer keep the repo with the branch that has the commit locally, and none of my collaborator does. What can I do to delete this commit from Github page/UI?

jap
  • 53
  • 3
  • 4
  • Related: [Remove sensitive files and their commits from Git history](https://stackoverflow.com/questions/872565/remove-sensitive-files-and-their-commits-from-git-history) – Sajib Khan Dec 01 '17 at 06:32
  • Just clone the repository from github again, and you should have the bad commit again locally. You can do this in a new folder. then follow linked questions. – tkruse Dec 01 '17 at 06:38
  • The commit is actually orphaned because it is not merged and the branch that contained it has been deleted. So when I cloned it again, the commit was not cloned in the local repository, it is only accessible via Github UI page `github.com/$account/$repository/commit/`. Will the garbage collector clean up the orphaned commit? – jap Dec 01 '17 at 06:54

0 Answers0