Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fukurouzhong/249cff8b363f9ff31144cc216f669f07 to your computer and use it in GitHub Desktop.
Save fukurouzhong/249cff8b363f9ff31144cc216f669f07 to your computer and use it in GitHub Desktop.
How to delete untracked files in git
# delete untracked files
git clean -f
# delete untracked files as well as the directories
git clean -fd
# including gitignore file/directories (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
git clean -xfd
# before using git clean,with -n parameter to preview the files or directories will be deleted
git clean -nxfd
git clean -nf
git clean -nfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment