Skip to content
GitTree
Changes and commits

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….

FreeUpdated

Works in GitTree Free: every local Git feature, once you are signed in.

On this page
  1. Before you start
  2. Where to find it
  3. Steps
  4. Expected result
  5. Edit .gitignore directly
  6. If something goes wrong
  7. Questions
  8. Related

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….
ActionmacOSWindows and Linux
The command palette, then Edit .gitignore…⌘⇧PCtrl+Shift+P

Steps

  1. 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.

  2. Check the result

    GitTree adds the rule to .gitignore at the top of the working folder, and the file leaves your changes.

  3. Commit the .gitignore

    .gitignore itself 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.