36

昨日、GitHubのConnectBotのフォークにプッシュしました。私は一度プッシュし、自分が望むように変更を加えていないことに気づき、コミットをやり直して、もう一度プッシュしました。

現在、GitHubには両方のコミットがあります。

私のマスターブランチは2番目のコミットのみを追跡していますが、最初のコミットは引き続き使用可能であり、アクティビティフィードに残っています。修正されたバージョンではなく、誤ってそのコミットをプルしないようにするには、どうすれば削除できますか?

4

2 に答える 2

13

GitHubは、トップレベルの参照(タグ、ブランチ、reflogなど)から到達できないコミット(およびその他のオブジェクト)を定期的にガベージコレクションします。これは、時間の経過とともに(たとえば、翌月に)、このオブジェクトが消えることを意味します。

プルは、参照されるオブジェクトのみを含むパックを生成する必要があるため、クローンまたはプルの結果として誰もそのコミットを取得することはできません。例えば、

$ git clone git://github.com/nylen/connectbot.git
Cloning into connectbot...
remote: Counting objects: 6261, done.
remote: Compressing objects: 100% (1900/1900), done.
remote: Total 6261 (delta 3739), reused 5980 (delta 3520)
Receiving objects: 100% (6261/6261), 3.04 MiB | 3.40 MiB/s, done.
Resolving deltas: 100% (3739/3739), done.
$ git cat-file -t 1cd775d
fatal: Not a valid object name 1cd775d

本当にすぐに削除する必要がある場合は、GitHubサポートに連絡する必要があります。

于 2010-12-06T16:34:10.723 に答える
13

リポジトリを削除するか、GitHubに連絡してください

すべての問題を失う余裕があれば、リポジトリを削除して、悪いコミットなしで再作成することはうまくいくようです。データもコミットAPIから消えます(ただし、プッシュイベントは引き続き表示されます)。参照:https ://stackoverflow.com/a/32840254/895245

If you can't afford to lose issue data, GitHub support can manually delete dangling commits. For example, when I uploaded all GitHub commit emails to a repo they asked me to take it down, so I did, and they did a gc. Pull requests that contain the data have to be deleted however: that repo data remained accessible up to one year after initial takedown due to this.

Their current help page says:

you can permanently remove all of your repository's cached views and pull requests on GitHub by contacting GitHub Support.

Maybe making the repo private will also keep the issues around and get rid of the commit, I'm not sure. You lose starts/forks for sure though. Not sure if after restore the commits will be gone or not. But at least you might be able to keep a private backup of issues.

于 2015-09-29T09:24:09.220 に答える