Git清理被忽略的文件夹 [英] Git clean inside ignored folders

查看:275
本文介绍了Git清理被忽略的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含在gitignore中的文件夹 foo

   -  .gitignore(包含'foo')
- foo
*
*** bar

当我运行 git clean -f git clean -f -x 时,这不会删除栏(bar是一个普通文件)。

有没有办法告诉git清理被忽略的文件夹内部?


<解决方案

-fdx 将删除所有未跟踪的文件,包括目录。 -d 有必要让清理者进入未跟踪的目录。


I have a folder foo that is included in gitignore:

 - .gitignore  (this contains 'foo')
 - foo
    *
    *** bar

When I run git clean -f or git clean -f -x, this does not delete bar (bar is a normal file).

Is there a way to tell git to clean inside ignored folders?

解决方案

git clean -fdx will delete all untracked files, including directories. The -d is necessary to cause the cleaner to descend into the untracked dir.

这篇关于Git清理被忽略的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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