What is git status?
Why Interviewers Ask This
Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Git & GitHub development. It reveals whether you understand the building blocks that more complex concepts rely on.
Answer
git status shows the current state of the working directory and staging area — which changes have been staged, which haven't, and which files aren't tracked by Git. Output categories: Staged changes (ready to commit): green — these will be included in the next commit; Unstaged changes (modified tracked files): red — working directory differs from last commit, but not staged yet; Untracked files: red — new files Git has never tracked. Common outputs: "nothing to commit, working tree clean" — all tracked files match the last commit; "Changes to be committed" — something is staged; "Changes not staged for commit" — tracked files modified but not staged; "Untracked files" — new files not yet added. Short format: git status -s or --short — compact two-column output (M = modified, A = added, ? = untracked, left column = staged, right = unstaged). Branch info: status also shows current branch and relationship to the tracked remote (Your branch is ahead of "origin/main" by 2 commits). Use git status constantly — it guides your next action.
Common Mistake
Candidates often give textbook answers here. Interviewers are more impressed when you relate the concept to a specific problem you solved in a real Git & GitHub project.