What is git status?

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.