GithubでPull Requestは絶対消せない。ヤバい\(^o^)/オワタ

2013/10/16: Githubのhelp「Remove sensitive data」について追記

先日、初めて知ったのですが、GithubのプルリクをCloseは出来ても、削除は出来ない。(*1)

普段使う上では困らないのですが、パスワードなどの公開すべきでない情報がプルリクに含まれると、結構ヤバい事になる。

結論

結論を先に書くと「リポジトリを作り直すしかない

試したこと

プルリクしてるブランチを上書きする

パスワードなどの情報をコミットから(rebase -iなどで)消してからブランチを上書きしてみた。

$ git push -f origin topic_branch

プルリクに上書き前後の履歴が全て表示される...

プルリクエストしたブランチを削除する

実はGithubでプルリク中のブランチを削除すると、自動的にプルリクがCloseになる。

Closeになるだけだった...

追記: Remove sensitive data

リプライでGithubのhelpを紹介頂けたので、調べてみた。

リンク先の説明を読むと、filter-branchpush -fで消す方法が書かれている。

そして、肝心のGithub側のデータに関する記述があった。

Cached data on GitHub

Be warned that force-pushing does not erase commits on the remote repository, it simply introduces new ones and moves the branch pointer to point to them. If you are worried about users accessing the bad commits directly via SHA1, you will have to delete the repository and recreate it. If the commits were viewed online the pages may also be cached. Check for cached pages after you recreate the repository, if you find any open a ticket on GitHub Support and provide links so staff can purge them from the cache.

適当に訳すと「push -fで消しても、リモートリポジトリのコミットは消えないよ。SHA1で直接アクセスされるのが不安ならリポジトリ再作成してくれ」的な事が書かれている。(*2)

で、プルリクのページにSHA1が残り続けるので、やっぱりリポジトリ作り直すしかない・・・と(´・ω・)