Jake
Jake

Reputation: 4234

How to delete a commit from Github's history that is not present locally?

I pushed a commit to Github with some private information. I've created a new branch that no longer has that information, and I've deleted the old branch, so the commit doesn't show up in the history of the branches.

However, you can still access a Github page showing the old commit using a URL in this format: https://github.com/me/myrepo/commit/4d929e07c2a61f261950f37af8d6fe5ec5ed05e1#diff-84e94b10bf89d08c7eb37dc4887fc612fb3115ff806e2661eb9e07c2a6186ebeR1. The commit in question does not show up if you run git log.

How can I get rid of it?

Upvotes: 2

Views: 5278

Answers (1)

Kim Hallberg
Kim Hallberg

Reputation: 1265

GitHub has extensive documentation about this. They have a documentation page for this called Removing sensitive data from a repository that I would recommend you read.

They suggest you contact GitHub Support so they can remove the cached version of the history.

Hope that helps somewhat.

Upvotes: 4

Related Questions