.gitignore/folder vs文件夹/ [英] .gitignore /folder vs folder/
问题描述
.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屋!