git clean
Git管理対象外のファイルを削除するコマンド。
用例
- カレントフォルダの削除対象ファイルを確認
git clean -n
- カレントフォルダの削除対象ファイルを強制的に削除
git clean -f
- カレントフォルダの hoge.txtファイルのみを強制的に削除
git clean -f hoge.txt
- カレントフォルダの削除対象ファイルで、hoge.txtファイル以外を強制的に削除
git clean -f -e hoge.txt
- カレントフォルダの削除対象のファイルとディレクトリを削除
git clean -d -f
- カレントフォルダの削除対象ファイルを強制的に削除(結果は表示しない)
git clean -f -q
- 削除対象ファイルを対話モードで削除
git clean -i
書式
git clean [options]
公式によると以下の通り。
git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…
options
/x | xxx |
etc.
説明
XXXX
関連
- xxx
参考リンク
- git clean - Gitコマンド虎の巻
- Git - git-clean Documentation
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
その他メモ
Git管理下にあるファイルを削除するには、git rmコマンドを使用。