2020年11月22日 星期日

delete repos from github by bfg (DMCA takedown)

2020/11/13 收到 github 的 DMCA takedown

I'm contacting you on behalf of GitHub because we've received a DMCA takedown notice regarding the following content:

We're giving you 1 business day to make the changes identified in the following notice:

就是某個 repository 有違反版權的東西, 要你刪除或是替自己辯護。

趁這個機會了解如何真正刪除 git 上的東西。

由於 git 是版本控制, 基本上 commit 的東西就是會一直存在, 無法刪除, 所以要用很特別的方式才能「真正」刪除這些資料。

我用的是 bfg 這個工具。

java -jar ~/bfg-1.13.0.jar --no-blob-protection --delete-folders 目錄
ex: java -jar ~/bfg-1.13.0.jar --no-blob-protection --delete-folders network
java -jar ~/bfg-1.13.0.jar --no-blob-protection --delete-files 檔案
ex: java -jar ~/bfg-1.13.0.jar --no-blob-protection --delete-folders a.txt
然後在執行以下 git 指令
git reflog expire --expire=now --all && git gc --prune=now --aggressive

很複雜吧, 我自己也不知道在幹嘛, 不過還沒完 ...

push 回去
git push
如果遇到錯誤訊息, 改用以下指令
git push origin --force --all

這樣在 github 上的東西就真的刪除了。

一般來說我們很少會需要這種操作, 通常是用在不小心把帳號/密碼之類的檔案 commit 進去, 才會需要用到這招。

然後在回信給 github 說已經刪除相關有問題的檔案, 如果沒有做任何處理, 一天之後, 這個 repository 會被封鎖。

We're giving you 1 business day to make the changes identified in the following notice:

我對這句話很不爽, 就算我英文不好, 也能感受到滿滿不舒服, 而且只給一天。

以後會以 bitbucket 為主, 新的程式碼會優先放在 bitbucket。

ref:
bfg:

沒有留言:

張貼留言

使用 google 的 reCAPTCHA 驗證碼, 總算可以輕鬆留言了。

我實在受不了 spam 了, 又不想讓大家的眼睛花掉, 只好放棄匿名留言。這是沒辦法中的辦法了。留言的朋友需要有 google 帳號。