Glob Pattern and .gitignore Tester

Paste rules and paths, or pick a project folder, and instantly see every match, the rule that decided it, and rules that never match anything.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Choose the mode

    Pick .gitignore, .dockerignore or Glob patterns at the top.

  2. 2
    Enter the rules

    Type the patterns or open your existing .gitignore, .dockerignore or pattern file.

  3. 3
    Add paths

    Paste paths one per line, end folders with a slash, or pick a project folder to read its file names locally.

  4. 4
    Read the results

    Each path shows ignored or kept (selected or not) with the rule line that decided it.

  5. 5
    Clean up the rules

    Fix lines highlighted in red, which decided nothing, and check the compiled regular expressions.

  6. 6
    Export

    Download the ignored and kept lists or the edited rules file.

About this tool

Glob patterns decide what gets committed, built, linted, copied into a Docker image or published to npm, yet they are usually written by trial and error: change a line, run the tool, look at what happened, repeat. Small details trip everyone up. In a .gitignore a pattern without a slash matches at any depth while one with a slash is tied to the root, a trailing slash limits it to folders, the last matching line wins, and a file inside an ignored folder can never be brought back with an exclamation mark. Docker reads almost the same syntax with different rules, and build tools such as tsconfig include, ESLint, Prettier and fast-glob use plain globs where a star does not match dotfiles by default. This tester shows the effect of every line at once. Choose .gitignore, .dockerignore or glob list mode, type or open the rules, and paste paths one per line (git ls-files and find output both work) or pick a folder on your computer, whose file names are read locally without opening or uploading any file. Each path is marked ignored or kept, or selected or not selected in glob mode, together with the exact line that decided it and a note when a parent folder was the reason. The line numbers beside the editor show how many paths each rule decided, and rules that decide nothing are highlighted, which quickly exposes typos and dead lines. The glob engine supports *, ** at any position, ?, character classes with ranges, negation and POSIX names such as [[:digit:]], braces with lists and numeric or letter ranges, extglobs @( ), *( ), +( ), ?( ) and !( ), escapes, dotfile handling, case-insensitive matching and base-name matching. Every rule is also shown as the regular expression it compiles to.

The three modes

In .gitignore mode, a pattern with no slash (or only a trailing one) matches a name at any depth, a leading slash or a slash in the middle anchors it to the root, and a trailing slash makes it match folders only. Folders are checked first: once a folder is ignored, Git never looks inside it, so a later !rule cannot re-include its files. In .dockerignore mode every pattern starts at the build context root, the trailing slash has no special meaning, and exceptions can re-include files even inside an excluded folder, as Docker's pattern matcher does. In glob list mode, a path is selected when any positive pattern matches and no pattern starting with ! matches it.

Folders in the path list

Lines ending with / are treated as folders. Turn on Also list the folders to add every folder on the way to each file, which is useful for seeing which folder rule did the work. When you pick a folder, its own name is removed so paths start at the project root, and up to 50,000 files are read.

Typical mistakes this catches

Writing /node_modules when the project has node_modules folders in sub-packages; ignoring a folder and then trying to keep one file inside it; expecting *.js to match files in sub-folders in glob mode; forgetting that ** does not match dotfiles such as .github unless dot matching is on; and leaving rules for files that no longer exist.

Limits

The tester follows the documented rules of Git, Docker and common glob libraries, but individual tools differ in edge cases, for example nested .gitignore files in sub-folders, the global excludes file and core.ignorecase in Git, or brace and extglob support in specific libraries. Check with git check-ignore -v or the tool itself before relying on an unusual pattern. It does not read file contents.

Worked example

A 14-line .gitignore with 8 rules is tested against 16 paths from a small TypeScript project. 7 paths are ignored: node_modules/react/index.js and packages/web/node_modules/vite/bin.js through the folder rule node_modules/ on line 2, dist/app.min.js through /dist on line 5, src/utils/.cache/tmp.js through .cache/ on line 14, debug.log by *.log, logs/2026-11-05.log by logs/** on line 7 (the later of two matching lines) and .env. 9 are kept, including logs/keep.txt and .env.example, which negated rules bring back. In glob mode, the brace pattern for .ts and .tsx files under src plus !**/*.test.ts selects only src/index.ts and src/components/Button.tsx.

Quick facts

Frequently asked questions

Why is my !rule not re-including a file?

In Git, if a parent folder is ignored, Git does not look inside it, so nothing in it can be re-included. Ignore the folder's contents instead, for example logs/** or logs/* rather than logs/, and then add !logs/keep.txt. The tester shows a parent folder note when this happens.

What is the difference between /build, build and build/?

/build matches only build at the root of the repository, as a file or folder. build matches a file or folder named build at any depth. build/ matches only folders named build, at any depth.

Does * match files in sub-folders?

No. A single star matches any characters except the slash, so *.js matches app.js but not src/app.js. Use **/*.js for any depth. In .gitignore files a pattern without a slash already matches at any depth.

Why do my patterns not match .github or .env files?

Most glob libraries do not let * and ** match names that start with a dot unless you enable a dot option. Turn on Match dotfiles in glob mode to test that behaviour. Git and Docker ignore files always match dotfiles.

Can I test a whole project without uploading it?

Yes. Pick a folder and the browser gives the page only the relative file names, which are processed in the tab. File contents are never opened and nothing is sent to a server.

Which tools use plain glob lists?

tsconfig include and exclude, ESLint and Prettier ignore patterns, fast-glob, globby, node-glob, picomatch, GitHub Actions path filters and many build tools. They differ slightly in options, so the dot, case and base-name switches let you match your tool's settings.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages