git rm
Git管理下にあるファイルを削除するコマンド。
用例
- ファイル「hoge.txt」が削除できるか確認する
git rm -n hoge.txt
- ファイル「hoge.txt」を削除
git rm hoge.txt
- カレントで、拡張子が「.txt」のファイル全てを削除
git rm *.txt
- ファイル「hoge.txt」をインデックスからのみ削除
git rm --cached hoge.txt
書式
git rm [options] <対象ファイル>
公式によると以下の通り。
git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>…]
options
/x | xxx |
etc.
説明
Git管理下にあるファイルを削除するコマンド。
- Git管理下に無いファイルを削除するには、git cleanコマンドを使用する。
関連
- git cleanコマンド
参考リンク
- git rm - Gitコマンド虎の巻
- Git - git-rm Documentation
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
その他メモ
なにかあれば。