Skip to content

A simple react app to manually input .gitignore patterns and a directory / filename tree and show what matches

License

Notifications You must be signed in to change notification settings

strlns/gitignore-patterns

Repository files navigation

gitignore-patterns

What is this?

Create directory trees and file names in your browser and validate .gitignore pattern syntax against the given tree.

Deployment

This project is auto-deployed to GitHub pages using GitHub Actions.

Try it in your browser

Motivation for this project

A misunderstanding I once had regarding parsing of ignore patterns, which emerged while creating a .prettierignore file.

See this repository (first commit vs 2nd commit).

From git-scm documentation:

An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

(emphasis mine)


Other info

This seems to be a common misunderstanding, as for example this parser, which I previously used in this project, does not handle that case correctly.

Now this project uses the same parser that prettier and a lot of other projects use:

ignore


This project uses Vite and was scaffolded using create-vite-app.

Also uses geist-ui.

About

A simple react app to manually input .gitignore patterns and a directory / filename tree and show what matches

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published