Git Status
Part of the Version Control section of Coddy's Terminal journey — lesson 7 of 58.
The most-used Git command by far is git status. It tells you the current state of your repository: which files have changed, which are staged, and which are not being tracked yet.
git statusIn a freshly initialized repo with no files, the output looks like:
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)Once you add files, git status highlights them under Untracked files. As you make commits, it shows what is modified, staged, or clean.
For a compact, machine-friendly view, use the short form:
git status --shortThis prints one line per changed file, with a two-letter code explaining its state (we will cover those codes in the next chapter).
Challenge
BeginnerThe folder already contains an untracked file called hello.txt. Initialize the repository, then run git status --short to see the file marked as untracked.
Untracked files appear with the prefix ??.
Cheat sheet
Use git status to see the current state of your repository:
git statusFor a compact one-line-per-file view:
git status --shortUntracked files are prefixed with ?? in short format.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore