Getting Started Git Basics File states

File states

Learn the main Git file states, including untracked, modified, staged, and committed.

Git tracks files through a small set of states such as untracked, modified, staged, and committed.

These states help you understand where a file currently stands in the Git workflow and what will happen if you commit right now.

The main file states

Here are the most important states to know:

  • Untracked: Git sees the file in your worktree, but it is not part of the repository history yet.
  • Modified: The file is already tracked by Git, and you changed it in the worktree.
  • Staged: You selected the file's current changes for the next commit.
  • Committed: The current version of the file is already saved in the repository history.

In practice, a file can move between these states as you work.

A simple state flow

A common path looks like this:

  1. You create a new file, so it starts as untracked.
  2. You stage it, so Git knows to include it in the next commit.
  3. You commit it, so it becomes part of history.
  4. You edit it again later, so it becomes modified.
  5. You stage the new changes, then commit again.

Existing tracked files usually move between modified, staged, and committed.

Untracked vs tracked files

The first big distinction is whether Git is already tracking a file.

If a file is untracked, Git has not yet recorded it in the repository history. That means Git is not yet keeping track of changes made to that file.

If a file is tracked, Git already knows about it from an earlier commit. Once a file is tracked, future edits usually show up as modified changes instead of untracked files.

A tracked file does not become untracked again just because you edit it. It stays tracked until it is removed from the repository.

Modified vs staged

This is one of the most important Git concepts for beginners.

A modified file has local edits in the worktree, but those edits are not yet selected for the next commit.

A staged file has changes that are ready to go into the next commit.

That means:

  • Modified does not automatically mean "will be committed next."
  • Staged means "currently selected for the next commit."

You can also have both staged and unstaged changes in the same file if you stage only part of its edits.

Deleted files and renames

Git status can also reflect changes such as deletions and renames.

For example:

  • If you delete a tracked file, Git reports that as a change.
  • If you rename a file, Git can often recognize the rename when comparing versions.

These are still part of the same general idea: Git is telling you how the worktree differs from the staged or committed state.

File states in GitComet

GitComet uses these file states to show you what needs attention in a repository.

That helps you quickly see:

  • Which files are new.
  • Which tracked files were edited.
  • Which changes are staged.
  • What would be included in the next commit.

Documentation

Search

move open Esc close

Browse the docs or start typing to filter results.