git 清除未跟踪的文件
来源:互联网 发布:电通安吉斯网络测评 编辑:程序博客网 时间:2024/05/19 05:37
有时做Build会引入很多之前没加入.gitignore的文件。这时你不可能每个目录每个文件地去删。
你要做的,git都帮你做好了。
hyang0@positive$ git --version
git version 1.7.4.1
git clean -df可帮你搞定一切。
举例:
git clean -dn 这个命令可以看看有哪此文件和目录会被删
git clean -f 只会删文件,不会删目录
hyang0@positive$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: .gitignore
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# COPYING
# INSTALL
# Makefile.in
# aclocal.m4
# autom4te.cache/
# config.h.in
# configure
# depcomp
# install-sh
# missing
no changes added to commit (use "git add" and/or "git commit -a")
hyang0@positive$ git clean -dn
Would remove COPYING
Would remove INSTALL
Would remove Makefile.in
Would remove aclocal.m4
Would remove autom4te.cache/
Would remove config.h.in
Would remove configure
Would remove depcomp
Would remove install-sh
Would remove missing
hyang0@positive$ git clean -df
Removing COPYING
Removing INSTALL
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing config.h.in
Removing configure
Removing depcomp
Removing install-sh
Removing missing
hyang0@positive$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: .gitignore
#
no changes added to commit (use "git add" and/or "git commit -a")
网址:http://hi.baidu.com/d_life/blog/item/c5ef6e82b3c424a76c811983.html
- git 清除未跟踪的文件
- git删除未跟踪文件
- git删除未跟踪文件
- git 删除未跟踪文件
- git删除未跟踪文件
- 处理未跟踪文件
- git中删除已跟踪文件的跟踪
- Git忽略已经跟踪的文件
- Git忽略已经跟踪的文件
- Git忽略已跟踪文件的改动
- Git回退取消文件的跟踪
- Git忽略已经跟踪的文件
- git忽略已被跟踪的文件
- git忽略已被跟踪的文件
- git忽略已被跟踪的文件
- 让git忽略已经跟踪的文件
- git 忽略已经跟踪文件的改动
- git忽略已跟踪的文件状态
- 美女搭讪
- Balsamiq Mockups注册码
- APT的使用
- jquery.validate的使用心得
- 解决Logback生成的日志文件不能显示中文的问题
- git 清除未跟踪的文件
- UVA 10815 - Andy's First Dictionary
- iOS下的Notification的使用
- hdu 1305(字典树)注意本题的输入!!!
- 美丽也是可以练出来的
- Oracle数据库新手学习笔记之错误解决ORA-12560:TNS协议适配器错误
- 金融常识总结四
- 动态修改Windows Service名称
- CListCtrl使用技巧