Q: .gitignore and asterisk "*"
- From
- Windl, 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