• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

gitリポジトリに間違って追加してしまったファイル等を完全に消去する方法を紹介します。

   1  % git filter-branch -f --index-filter 'git update-index --remove "filename"' HEAD
   2  % git push --force

ディレクトリを削除したい場合は、ディレクトリの中身のファイルを1つずつ全て削除します。

ポイント

  • 上記のコマンドはワーキングディレクトリのROOTで実行する必要があります。
  • "filename"はワーキングディレクトリのROOTからの相対パスで記述します。
  • "-f" オプションはつけておいた方が良いです。
posted by Png genki on Sun 30 Aug 2009 at 08:47

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry1592
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ