Skip to content
Marvin's Toolbox.

Glob Tester

Test glob patterns and .gitignore rules against a list of file paths and see which ones match, which are ignored and which rule decided it.

Runs entirely in your browser. Nothing you put in here gets uploaded.

Rules and paths

3 patterns

One pattern per line. A path matches when any pattern matches it and no ! pattern does. Lines starting with # are comments.

16 paths

One path per line, relative to the project root. End a line with / to mark a directory. Backslashes count as separators.

Results

Matching
4
Not matching
12
  • Matches:README.md
    Matched by L2*.md
  • No match:.env
    No pattern matches
  • No match:.github/workflows/ci.yml
    No pattern matches
  • No match:package.json
    No pattern matches
  • Matches:src/index.ts
    Matched by L1src/**/*.{ts,tsx}
  • Matches:src/app.tsx
    Matched by L1src/**/*.{ts,tsx}
  • Matches:src/utils/format.ts
    Matched by L1src/**/*.{ts,tsx}
  • Excluded:src/utils/format.test.ts
    Excluded by L3!**/*.test.ts
  • No match:src/styles/main.css
    No pattern matches
  • No match:docs/guide.md
    No pattern matches
  • No match:build/main.js
    No pattern matches
  • No match:build/main.js.map
    No pattern matches
  • No match:logs/debug.log
    No pattern matches
  • No match:logs/keep.log
    No pattern matches
  • No match:node_modules/react/index.js
    No pattern matches
  • No match:coverage/lcov.info
    No pattern matches

Per pattern

How many paths each pattern matches, and how many it decided. The first matching pattern gets the credit, and a matching ! pattern always wins.

LinePatternMatchesDecides
1
src/**/*.{ts,tsx}
43
2
*.md
11
3
!**/*.test.ts
11

Glob syntax

*any characters inside one path segment
**any number of directories, including none
?exactly one character
[abc] [a-z]one character from the set or range
{ts,tsx}either alternative
{1..3}a numeric range, 1, 2 or 3
!patternleave out whatever the pattern matches
+(a|b) !(a)extglobs: one or more of, anything except
\*a literal star, escape any special character

Next steps

Keep going. These tools open with your result loaded in.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the Glob Tester Tool

This tool tests glob patterns and .gitignore rules against a list of file paths. Paste the paths, one per line, add your patterns or your .gitignore, and every path shows whether it matches or is ignored, together with the exact line that decided it.

Glob mode works like the pattern lists in build tools and linters: a path matches when any pattern matches it and no ! pattern does. The .gitignore mode follows git's own rules, so the last matching rule wins, a ! rule can re-include a path, and nothing inside an ignored directory can be brought back. When a re-include has no effect for that reason, the tool tells you which directory is in the way.

What you can do

  • Test a glob pattern against a list of file paths
  • Check which files a .gitignore ignores before you commit
  • Find out which .gitignore rule ignores a file
  • Debug a ! negation in a .gitignore that does not re-include a file
  • Exclude files from a glob with ! patterns
  • Match dot files, ignore case or match the basename only
  • Find .gitignore rules that never decide anything
  • Copy the list of matching or ignored paths

How to use the Glob Tester

  1. 1Pick Glob or .gitignore at the top of the tool.
  2. 2Type your patterns, or paste your .gitignore, into the left editor.
  3. 3Paste the paths to test into the right editor, one per line. End a line with / to mark a directory.
  4. 4Read the result for each path and the rule that decided it, or filter the list down to the matches.
  5. 5Copy the matching or ignored paths, or check the per rule table for lines that do nothing.

How glob patterns combine

Patterns are matched with picomatch, the engine behind micromatch, fast-glob and many build tools. * stays inside one directory, ** crosses any number of them, {ts,tsx} picks one of several alternatives and [a-z] one character from a range.

A list of patterns is combined the way globby and fast-glob do it. A path matches when at least one positive pattern matches and no ! pattern does, wherever the ! line sits in the list. A list made only of ! patterns starts from every path, so !*.md alone keeps everything that is not Markdown. Dot files are skipped by * and ** unless you turn on Match dot files or write the dot yourself, as in .github/**.

How git decides what a .gitignore ignores

Git walks every path from the top. For each directory on the way it checks the rules, and the last rule that matches wins. Once a directory is ignored, git never looks inside it again, so a later !build/keep.js cannot bring back a file from an ignored build/. Ignore build/* instead and the re-include works, because the directory itself stays visible.

A rule without a slash, like *.log, matches at any depth. A slash at the start or in the middle anchors it to the root, and a slash at the end matches directories only. To list a directory in the path list, end it with a slash, the same way git check-ignore expects it.

Tools that share a tag with this one.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Open a CSV or TSV file and read it as a proper table. Sort by any column, filter rows with a search or per-column conditions, hide columns you do not need, and copy or download what is left.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.