Git:如何忽略隐藏的目录? [英] Git: how to ignore hidden directories?

查看:569
本文介绍了Git:如何忽略隐藏的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望让Git忽略所有隐藏的文件和目录,即 .aptitude .ssh / .bash_rc 。有没有一个简单的规则来覆盖这一点,而不是专门添加每个条目? 只需添加一个模式到 .gitignore

 。* 
!/。gitignore

$ b

编辑:添加了 .gitignore 文件本身(如果它尚未提交,则是重要的)。

I'd like to have Git ignore all hidden files and directories, i.e. .aptitude, .ssh/ and .bash_rc. Is there a simple rule to cover this without specifically adding each entry?

解决方案

Just add a pattern to .gitignore

.*
!/.gitignore

Edit: Added the .gitignore file itself (matters if it is not yet commited).

这篇关于Git:如何忽略隐藏的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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