gitを使っていて、間違ったファイルをgit addしてしまった場合に、 これをキャンセルする為には、以下のコマンドが使えます。

   1  % git rm --cached <filename>

git rmは、Working Tree (作業コピー)と index からファイルを削除するコマンドですが、 --cachedを指定する事で、 indexからのみファイルを削除する事ができます。

git addはWorking Treeからindexにファイルを追加するコマンドなので、 git rm --cachedは、git addと対をなすコマンドだと言えますね。

posted by Png genki on Fri 17 Oct 2008 at 01:44

Comments:

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