LoginSignup
5
4

More than 5 years have passed since last update.

git -rm でファイル削除を反映するとき複数のファイル全部を指定する方法

Posted at

ローカル上で削除したファイルを反映するには

例えばこんな状況

# ファイルを削除した後
$ git status
# On branch hogebranch
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       deleted:    hoge.erb
#       deleted:    hoge.erb1
#       deleted:    hoge.erb2
#       deleted:    hoge.erb3
#       deleted:    hoge.erb4
#       deleted:    hoge.erb5
#       deleted:    hoge.erb6


普段はrm を使って反映させます。

# ファイルを削除した後
$ git rm <ファイル名>

ローカル上で削除した複数のファイルを一気に反映するには

一気に削除したい 場合

$ git add -u
$ git status
# -uを使ってステータスを確認すると色が変わって反映できることが分かります。

以上

5
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
5
4