参考:
git filter-branchで大事なデータを消去・上書き - Qiita
git filter-branch
filter-branchを使う
git filter-branch -f --index-filter \
'git rm --ignore-unmatch data/WindowsXP-KB835935-SP2-JPN.exe' HEAD
途中以下で止まることがある。
git insufficient permission for adding an object to repository database ./objects
これは .git/objects/ 内のパーミッションがおかしい。
uidが自分以外のものを調査
find .git/objects ! -uid `id -u`
たいがいrootユーザが原因
find .git/objects -uid 0
Warning: commit message does not conform to UTF-8.
You may want to amend it after fixing the message, or set the config
コミット時の文字コードが悪かった様子。無視
本当はこれがやりたかった
- WindowsXP-KB835935-SP2-JPN.exe
- WindowsXP-KB936929-SP3-x86-JPN.exe
200MB、300MBとか巨大なファイルをコミットされた・・・
しかもコミットされたのが結構過去なのでまいった。
.git/objects/ 以下のサイズがその分食っているので消したくて調べた。
-> これやってもサイズ減ってくれなかった。