git clean
来源:互联网 发布:ipad找不到蜂窝数据 编辑:程序博客网 时间:2024/06/01 12:00
As per the Git Documentation git clean
Remove untracked files from the working tree
Step 1 is to show what will be deleted by using the -n
option:
git clean -n
Clean Step - beware: this will delete files:
git clean -f
- To remove directories, run
git clean -f -d
orgit clean -fd
- To remove ignored files, run
git clean -f -X
orgit clean -fX
- To remove ignored and non-ignored files, run
git clean -f -x
orgit clean -fx
Note the case difference on the X
for the two latter commands.
If clean.requireForce
is set to "true" (the default) in your configuration, one needs to specify -f
otherwise nothing will actually happen.
Again see the git-clean
docs for more information.
Options
-f
--force
If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to run unless given -f, -n or -i.
-x
Don’t use the standard ignore rules read from .gitignore (per directory) and $GIT_DIR/info/exclude, but do still use the ignore rules given with -e options. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.
-X
Remove only files ignored by Git. This may be useful to rebuild everything from scratch, but keep manually created files.
-n
--dry-run
Don’t actually remove anything, just show what would be done.
-d
Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different Git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.
- git clean
- git clean
- git clean
- git clean
- git clean
- git clean 小结
- git clean reset checkout
- git clean untracked files
- git clean命令
- [git]Clean命令
- Git reset&Git clean简介
- git解决冲突 git clean -d -fx
- 好用的git clean命令
- Clean Empty Directories on Unity3D and Git
- clean
- 删除没有git add的文件——git clean
- 【git系列之A】git clean的用法
- clean clean
- Nginx(Https) + Tomcat 启用 Https(SSL) 支持
- 区块链技术进阶
- java静态代码块和静态方法的区别和调用顺序、static用法
- hdu找新朋友 欧拉函数
- dubbo框架
- git clean
- Beyond Compare怎么备份文件到指定文件夹
- Python-003-数据类型1--数字、字符串、布尔值
- 基础练习:报时助手
- Track all remote git branches as local branches
- spring和springmvc的区别
- Android 获得安装应用列表
- python2 与 python3的区别(逐渐发掘)
- 项目管理阶段图标说明