Re: git glob pattern in .gitignore and git command
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 3, 2018, 17:43 UTC
- Message-ID
- <CACsJy8Ar93y19JuYK+_NDQOn=4+8EH6e+9vWOQZNMGnLgExF-w@mail.gmail.com>
- In-Reply-To
- <20180603005834.rwl5mx7llrv767xn@HP>
On Sun, Jun 3, 2018 at 2:58 AM, Yubin Ruan <ablacktshirt@gmail.com> wrote:
> To ignore all .js file under a directory `lib', I can use "lib/**/js" to match > them. But when using git command such as "git add", using "git add lib/\*.js" > is sufficient. Why is this difference in glob mode?
Historical reasons mostly. '**' comes later when '*' already establishes its place. You can use '**' too with "git add ':(glob)lib/**/*.js'". See https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec
-- Duy