Ignore files from GitTree
Files you never want to commit, such as build output or local settings, belong in .gitignore. Right-click a new file in your working changes and choose what to ignore, or edit .gitignore directly with Edit .gitignore….
Works in GitTree Free: every local Git feature, once you are signed in.
On this page
Before you start
- A repository is open. A file that is already committed keeps being tracked even once ignored.
Where to find it
- Right-click a file in Working Changes: Ignore, with the file, its extension or its folder.
- The command palette: Edit .gitignore….
| Action | macOS | Windows and Linux |
|---|---|---|
| The command palette, then Edit .gitignore… | ⌘⇧P | Ctrl+Shift+P |
Steps
Choose what to ignore
Right-click the file and open Ignore: Ignore “…” for this file, All Files with the Extension “…”, or All Files in “…/” for its folder.
Check the result
GitTree adds the rule to
.gitignoreat the top of the working folder, and the file leaves your changes.Commit the .gitignore
.gitignoreitself now shows as changed: stage and commit it so everyone ignores the same files.
Expected result
The ignored files no longer appear in your changes and cannot be staged by accident.
Edit .gitignore directly
Edit .gitignore… opens the file with Rules, one per line. Add Template inserts the rules for a language or tool, and Why is this ignored? names the rule that hides a path you type. Save writes the file; commit it like any other change.
If something goes wrong
An ignored file still shows as changed
It was committed before the rule existed. Ignoring only affects untracked files; stop tracking the file first, then commit.
“The .gitignore changed since it was opened, so it was not saved.”
Something else wrote to it. Choose Reload, then make your change again.
Questions
Can I ignore a file only on my computer?
Yes, with .git/info/exclude, which is never committed. For a tracked file you change locally, see index flags.