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

Q: .gitignore and asterisk "*"

From
WUWindl, Ulrich <u.windl@ukr.de>
Date
Oct 30, 2026, 10:46 UTC
Message-ID
<07b3498d83424cac87221724b371839a@ukr.de>
Hi!

I think the documentation for gitignore(5) could be improved regarding "*": It's nor clear whether "*" matches an empty string. So when I have foo.log foo.msg foo.sh foo-whatever.log foo-whetever.msg Would e.g. "foo*.log" cover all the logs?

The manual says:
       •   An asterisk "*" matches anything except a slash. The character "?"
           matches any one character except "/". The range notation, e.g.
           [a-zA-Z], can be used to match one of the characters in a range.
           See fnmatch(3) and the FNM_PATHNAME flag for a more detailed
           description.

Kind regards, Ulrich Windl

Next: Junio C Hamano
Message 1 of 2 in “Q: .gitignore and asterisk "*"”
  1. Windl, UlrichOct 30, 2026
  2. Junio C HamanoOct 30, 2026

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.