Explain .gitignore code

Paste a .gitignore and Vibe explains which files each line leaves out, what a leading or trailing / changes and why a ! line sometimes can't bring a file back.

.gitignore

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe21 lines selected

Press Explain it for the sample, or paste your own code first.

What this .gitignore sample shows

patterns
Each line is a pattern, and # starts a comment. * matches any run of characters except /, so *.log left out both debug.log at the top and logs/today.log one folder down: a pattern with no slash in it matches in every folder. .env.* caught .env.local.
slashes and folders
A slash at the end, as in dist/, matches only folders and everything inside them: a plain file called dist was still listed by git status. A slash at the start ties the pattern to the folder the .gitignore is in, so /build/ left out build/out.js but kept src/build/helper.js.
negation
A line starting with ! brings back a file an earlier line left out, and the last line that matches wins. That kept .env.example, .vscode/extensions.json and uploads/.gitkeep while the rest of .env.*, .vscode/ and uploads/ stayed out.
tracked files
A .gitignore only affects files git isn't tracking yet. With .env already committed, adding it here changed nothing: git status still showed M .env after an edit. git rm --cached .env stopped tracking it and left the file on disk, and from then on git ignored it.

Good to know

  • Run with git 2.55.0 on a test project with 15 files besides the .gitignore, git status listed only .gitignore, .env.example, .vscode/extensions.json, src/app.js, src/build/helper.js and uploads/.gitkeep; everything else was left out.
  • git check-ignore -v <file> prints the line that decides a file, with its line number. For a file a ! line keeps, it prints that ! line, so check that the pattern it names doesn't start with ! before reading the file as ignored.
  • Commit the .gitignore itself, so everyone working on the project gets the same rules. Rules that are only yours go in .git/info/exclude, which works the same way and is never shared: notes-to-self.md listed there was left out of git status in this repo only.

Watch out: ! can't bring back a file whose folder is left out, because git never looks inside that folder. With logs/ and then !logs/keep.txt, git status still didn't list logs/keep.txt. Writing logs/* leaves out the folder's contents instead of the folder, and then !logs/keep.txt worked.

Explain .gitignore code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open