Ignoring a file

Adding an untracked file, or a folder of them, to .gitignore without leaving the list.

Some untracked files are never going to be committed: build output, a local configuration file, something an editor left behind. Rather than looking past them every time, add them to .gitignore from the row they are sitting on.

The action is in the row’s context menu, on any untracked file and on any folder that contains untracked files.

What it writes

A single root-anchored literal rule in the repository root’s .gitignore — the path as it is, anchored to the top of the repository, with no pattern matching invented on your behalf.

That is a deliberate limit. Innesta could guess that build/output.o means you want *.o, and it would sometimes be right and sometimes silently hide a file you wanted. A literal rule does exactly what you asked and nothing else; if you want a pattern, .gitignore is a text file and you can edit it.

The rule always goes in the repository root’s .gitignore, even for a deeply nested file, so there is one place to look when you want to know what is being ignored.