States of a File in Git Working Directory (original) (raw)

Last Updated : 13 Mar, 2026

In Git, files in the working directory move through different states during the development process, helping track and manage changes before they are committed.

Git Workflow

Git workflow describes how changes move through different areas of Git before being permanently stored in the repository.

Git File States

Git tracks files through different states in the working directory as they move from modification to staging and finally to being committed in the repository.

1. Untracked state

Untracked files are files in the working directory that Git is not currently tracking because they were not included in the previous commit.

geeksforgeeksuntracked-file

Untracked State in Git

2. Tracked state

Tracked files are files that Git already knows about because they were included in the last commit snapshot.

3. Modified State

A modified file is a tracked file whose contents have been changed but the changes have not yet been committed.

geeksforgeeksmodified-(1)

Modified States in Git

4. Staging State

A staged file is a file that has been prepared and marked by Git to be included in the next commit.

geeksforgeeksuntracked-staged

Staging State

Now, stage our modified tracked example.html file and run the git status command.

geeksforgeeksmodified-staged

Modified Tracked file

5. Committed State

A committed file is a file whose changes are permanently saved as a snapshot in the Git repository.

geeksforgeekscommitted-(1)

Git Commit