https://github.com/Niminem/gitignore
On my journey to create a coding agent I needed yet another library we don't currently have in our ecosystem.
This library is a parser and pattern matcher for .gitignore files, and effectively ports git's implementation. It's tested against their actual test tables. Stdlib only.
The gitignore libraries I've found in other languages mix parsing a pattern vs evaluating a file vs walking a repository. This one separates them into 3 distinct layers or APIs. One parses a single gitignore line and match paths against it, another parses a single file, and the other walks a repo.