Git Status

What

In Git, files inside your repository move through various states as you work on them. The primary states are:

  • Untracked: New files that Git does not know about yet and is not monitoring for changes.
  • Staged: Modified or new files that you have marked to be included in your next snapshot (commit).
  • Committed: Files whose changes have been safely saved to the local .git history database.

How

You can inspect the current state of your repository at any time by running the git status command:

# Check the status of your files
git status

If you have a new file named README.md that hasn’t been added yet, the output will list it under “Untracked files”.

Why

git status is the most frequently run command in a developer’s daily workflow. It acts as a safety checkpoint, ensuring you know exactly which files are staged for your next commit, which files have unstaged changes, and which new files are currently ignored or untracked. This prevents you from accidentally committing temporary files or omitting important changes.

Summary

Use git status to see the current state of your files and determine which ones are untracked, staged, or successfully committed.