アスタリスクのない同等のもので置き換えることのできない用途はありますか?.gitignoreのパスマッチング構文でアスタリスク "** /"が重複していますか?
Two consecutive asterisks ("**") in patterns matched against full
pathname may have special meaning:
A leading "**" followed by a slash means match in all directories.
For example, "**/foo" matches file or directory "foo" anywhere,
the same as pattern "foo". "**/foo/bar" matches file or directory
"bar" anywhere that is directly under directory "foo".
A trailing "/**" matches everything inside. For example, "abc/**"
matches all files inside directory "abc", relative to the location
of the .gitignore file, with infinite depth.
A slash followed by two consecutive asterisks then a slash matches
zero or more directories. For example, "a/**/b" matches "a/b",
"a/x/b", "a/x/y/b" and so on.
Other consecutive asterisks are considered invalid.
https://git-scm.com/docs/gitignore#_pattern_format
私は唯一の大手アスタリスク/スラッシュ冗長性について尋ねてることを、私が指摘してみましょう。
# NuGet Packages
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
と私は、彼らは単に書くことができなかった理由は、思ったんだけど:任意の**/foo/bar
は、例えば、単純なfoo/bar
に置き換えることができるので、私は私の.gitignore
ファイルに次き
# NuGet Packages
# The packages folder can be ignored because of Package Restore
packages/*
# except build/, which is used as an MSBuild target.
!packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!packages/repositories.config
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
最悪の例として、 'foo/bar'は' **/foo/bar'と同じです。しかし、アスタリスクを使用するたびに置き換えることはできません。 ;-) – Vampire
誰かが 'foo/bar'を気にします - 質問は**です** **/fooか/ foo .. :)私の例は正しいです;) –
しかしそれ以外: */foo/barはfoo/barと同じですか?質問への答えはイエスであり、私は間違っています –