0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Git】追跡されていないファイルを削除する方法

Posted at

git cleanを使用すると追跡されていないファイルを削除できます。

ドライラン

git cleanで削除対象となるファイルの一覧を確認したい場合には以下のコマンドを実行します。

git clean -n
$ git clean -n
Would remove img/iconFacebook.png
Would remove login.html
Would remove docs/README.md

ファイルの削除

以下のコマンドでファイルを削除します。

git clean -f

フォルダも含めて削除する場合には以下のように実行します。

git clean -fd

インタラクティブ

対話モードに入るには以下のコマンドを実行します。

git clean -i

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?