git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git glob pattern in .gitignore and git command

From
YRYubin Ruan <ablacktshirt@gmail.com>
Date
Jun 3, 2018, 00:58 UTC
Message-ID
<20180603005834.rwl5mx7llrv767xn@HP>

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?

I have heard that there are many different glob mode out there (e.g., bash has many different glob mode). So, which classes of glob mode does these two belong to? Do they have a name?

Yubin
Next: Philip Oakley
Message 1 of 3 in “git glob pattern in .gitignore and git command”
  1. Yubin RuanJun 3, 2018
  2. Philip OakleyJun 3, 2018
  3. Duy NguyenJun 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.