取消忽略全局.gitignore中的所有文件 [英] Un-ignore all files in global .gitignore

查看:115
本文介绍了取消忽略全局.gitignore中的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看 gitignore异常后,我意识到人们可以通过以下方式忽略存储库中的文件:全局.gitignore文件.

After looking at git ignore exception, I realized that one can ignore files in a repository from a global .gitignore file.

有什么方法可以覆盖全局.gitignore文件中的所有规则,以便存储库中包含所有内容,而不会忽略任何内容? (除了分别忽略每个文件之外)

Is there any way that you can override all rules from the global .gitignore file, so that the repository will have everything in it and nothing ignored? (besides un-ignoring every file individually)

推荐答案

使用一个规则在repo文件夹中创建一个.gitignore:

Create a .gitignore in the repo folder with one rule:

!*

这会忘记主.gitignore中所有文件(*)的规则(带有!).

This forgets the rules (with !) of all of the files (*) in the main .gitignore.

这篇关于取消忽略全局.gitignore中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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