Git & GitHub Interview Question #11

What does git status show?

Git Fundamentals, Repository, Working Tree, Staging, Commits & Branch Basics Junior Beginner

Quick Interview Answer

git status reports the current state of the working tree and staging area. It shows information such as the current branch, staged changes, unstaged changes, untracked files, and whether the branch is ahead of or behind its upstream.

Detailed Explanation

git status reports the current state of the working tree and staging area. It shows information such as the current branch, staged changes, unstaged changes, untracked files, and whether the branch is ahead of or behind its upstream.

It is one of the safest commands to run frequently because it helps you understand what Git sees before staging, committing, switching branches, or resolving conflicts.

Code Example

git status