LoginSignup
4
4

More than 5 years have passed since last update.

git filter-branchでリポジトリから機密情報を削除

Last updated at Posted at 2014-10-15

参考:

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/ 以下のサイズがその分食っているので消したくて調べた。
-> これやってもサイズ減ってくれなかった。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4