.gitignore/folder vs文件夹/ [英] .gitignore /folder vs folder/

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

问题描述

.gitignore中使用之间有什么区别

in .gitignore what is the difference between using

/bin

bin/

我将如何制作它以便删除某个文件,无论它在哪里?

And how would I make it so that it removes a certain file, no matter where it is?

*/*.ext

推荐答案

前导/将忽略模式锚定在树中特定 .gitignore 所在的位置

A leading / anchors the ignore pattern at the point in the tree where the particular .gitignore resides.

后跟的/表示模式将仅匹配目录(因此该匹配目录中的所有文件).

A trailing / means that a pattern will only match a directory (and so all the files in that matching directory).

例如,您可以同时拥有/bin/仅与名为 bin 的目录匹配,并且仅与 .gitignore 文件的级别匹配.

You can have both, e.g. /bin/ will match only a directory called bin and only at the level of the .gitignore file.

一个简单的 *.ext 将匹配任何以 .ext 结尾的文件,该文件位于 .gitignore 文件级别以下的任何位置或以下位置.出现.

A simple *.ext will match any file ending with .ext anywhere at or below the level of the .gitignore file in which it appears.

这篇关于.gitignore/folder vs文件夹/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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