git clean不能递归地工作 [英] git clean not working recursively

查看:101
本文介绍了git clean不能递归地工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到 git clean 的问题。
考虑以下情况:

  git status -su 
?? file_1
?? xyz / file_2

git clean -f
不删除xyz / file_2
删除file_1

我不想删除 xyz 文件夹,但想要移除 file_2 里面。
为什么 git clean 不能递归工作?

解决方案

如果你忽略它,使用 git clean -xf 。您可以执行 git clean -df ,但这也会删除未跟踪的目录。使用 -n 进行空运。

http://gitready.com/beginner/2009/01/16/cleaning-up-untracked-files.html


I am facing problems with git clean. consider the following scenario

git status -su
?? file_1
?? xyz/file_2

git clean -f
Not removing xyz/file_2
Removing file_1

i don't want to remove xyz folder, but want to remove the file_2 inside it. Why git clean is not working recursively ?

解决方案

If you have it in ignore, use git clean -xf. You can do git clean -df but that will also remove untracked directories. Use -n for a dry-run.

http://gitready.com/beginner/2009/01/16/cleaning-up-untracked-files.html

这篇关于git clean不能递归地工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆