LoginSignup
34
27

More than 5 years have passed since last update.

git statusで出るUntracked filesを削除する方法

Posted at

まず、「git status」でUntracked filesを確認

zsh
% git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    xxx/xxx
    yyy/yyy

「git clean」に「nオプション」を付け、削除するUntracked filesを確認

zsh
% git clean -n 
Would remove xxx/xxx
Would remove yyy/yyy

「git clean」に「fオプション」を付け、Untracked filesを削除

zsh
% git clean -f
Removing xxx/xxx
Removing yyy/yyy
34
27
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
34
27