Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Is it possible to modify/delete the reflog of a remote git repository, e.g. on Github?

Tags:

git

github

Asking for a friend.

Scenario

Confidential information has been pushed to a public github repository by accident. As soon as the commiter noticed the failure he decided to override git history with push -f to remove the information from the web.

Problem

  • The confidential information is still accessible via git reflog at github. So the staff at github is still able to access the information.

  • Even worse, if the commiter has put a reference in the initial commit message, e.g. referencing an issue using the #-sign, github would automatically put a link to the commit into that issue. In this case the overridden information is still accessible via the github frontend.

Question

  • Is it possible to modify/delete the reflog of a remote git or github repository?
  • If it is not possible. What would you do in the given scenario? Delete the issue with the reference to the first commit? Delete the whole repository? Whate else?
like image 248
jschnasse Avatar asked Oct 27 '25 14:10

jschnasse


1 Answers

As long as plain Git is concerned, no it is not possible.

But on the other hand, "remote" repositories — those everyone pushes to and fetches from — are "bare", and bare repositories are initialized with reflog disabled by default.

As to Github, this is completely another story as they do not serve the repositories using "plain" Git, and consequently server-side management of the repositories is really outside of Git realm — please see what the Github docu says:

'Once you have pushed a commit to GitHub, you should consider any data it contains to be compromised.'

What to do next? If data has been compromised

1) re-write the history using any of the available tools;

2) Force-push the result to overwrite what's already there.

3) Contact Github for further assistance. If that happened at your $dayjob, this should be an official contact. Before doing that, whoever is to contact Github should read their "terms and conditions". When contacting, one should politely ask about what possible repercussions are, and whether it's possible to prevent possible spreading of the compromised information using ways other than fetching from the repo (which was already fixed). I mean, say, repo replicas or backups or whatnot internal to Github

like image 162
kostix Avatar answered Oct 29 '25 05:10

kostix