0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

git clean

Posted at

FBI warning: git clean -df 之后的文件无法恢复

git clean -n
是一次clean的演示, 告诉你哪些文件会被删除。 这个命令不会真正的删除文件,只是一个提醒。

git clean -f
删除当前目录下所有没有track过的文件。不会删除 .gitignore文件里指定的文件夹和文件,不管这些文件有没有被track过。

git clean -f <path>
删除指定路径下的没有被track过的文件

git clean -df
删除当前目录下没有被track过的文件和文件夹

git clean -xf
删除当前目录下所有没有track过的文件。不管是不是.gitignore文件里面指定的文件夹和文件。


参考:

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?