Inline comment
- Input
- *.log # logs → app.log
- Expected output
- não ignorado / not ignored
The pattern became *.log # logs, which does not match app.log.
gitignore not working
Paste the .gitignore and the file list in the Test tab. The tool shows which line decides each path, and the linter flags trailing spaces, inline comments, backslashes and unclosed classes.
The pattern became *.log # logs, which does not match app.log.
The rule becomes buildout; write build/out.
The * does not cross the slash; use src/**/*.js.
With core.ignorecase=true it would be ignored.
The space is dropped, so the rule works; the linter only warns.
Tap the shortcut for your stack (Next.js, Python, Laravel, Unity and others) or search by name: react and vite open the Node template, django opens Python. Add the editor (Visual Studio Code, JetBrains) and the operating system (macOS, Windows, Linux) of the people working on the project, copy the result and save it as .gitignore at the repository root. Editor and OS templates can also go to a global file (core.excludesFile) so they do not clutter the project.
Run git check-ignore -v path. The output gives the file, the line and the pattern, and a negation shows with the ! in front. With no output, no rule matches the path.
No, Git re-reads the file on every command. What does not change is what is already tracked: the fix there is git rm --cached and a commit.
Yes: its rules apply to the subfolder and everything below, and patterns with a slash are anchored there. In the Test tab, the Folder that holds the .gitignore field simulates this.
Loading templates...
Pick at least one template to generate the file.
Loading templates...
# Normalize line endings: Git detects text files, LF in the repository. * text=auto eol=lf # Shell scripts need LF; Windows scripts need CRLF. *.sh text eol=lf *.bat text eol=crlf *.cmd text eol=crlf *.ps1 text eol=crlf # Binary files: no conversion and no text diff. *.png binary *.jpg binary *.jpeg binary *.gif binary *.ico binary *.webp binary *.pdf binary *.zip binary *.gz binary *.woff binary *.woff2 binary # Lock files: GitHub collapses them in diffs. package-lock.json linguist-generated yarn.lock linguist-generated pnpm-lock.yaml linguist-generated
.gitignore only applies to files Git does not track yet. To stop tracking without deleting from disk:
git rm --cached path/to/file git rm -r --cached path/to/folder git commit -m "Stop tracking ignored files"
To re-apply the .gitignore to everything at once (review git status before committing):
git rm -r --cached . git add . git commit -m "Apply .gitignore"
To ignore only on your machine, use a global file (core.excludesFile) or the clone's .git/info/exclude, with the same syntax:
git config --global core.excludesFile ~/.gitignore_global .git/info/exclude
No problems found in the rules.