git status
The Git command that reports what is staged, what is changed but not staged, and what is untracked.
In more detail
Changes to be committed are in the staging area, changes not staged for commit are in the working tree only, and untracked files are in neither. --short prints two columns per file: the left one for the staging area and the right one for the working tree, so an M in both columns means the file was staged and then modified again. --branch adds the current branch and how far it is ahead of or behind its upstream.
Example
git status --short --branchRelated terms
- three areas — Git's model of where a change can be: the working tree on disk, the staging area waiting for the next commit, and the repository of recorded commits.
- staging area — Git's list of exactly what the next commit will contain, kept in the file .git/index; also called the index.
- tracked file — A file Git already knows about because it is in the last commit or the staging area; any other file is untracked.
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
- Git — A free, open-source distributed version control system that records the history of a project as a chain of snapshots.
Taught in
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- The Three Areas: Working Tree, Index, Repository — Advanced Git Internals & Distributed Workflows
- Staging Deliberately: status, add, add --patch — Advanced Git Internals & Distributed Workflows
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- Ignoring Files, And The Tracked File Trap — Advanced Git Internals & Distributed Workflows
- HEAD, And Why Detached HEAD Is Not An Error — Advanced Git Internals & Distributed Workflows
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows
- Undoing: restore, reset, revert And stash — Advanced Git Internals & Distributed Workflows
- Clone, Forks, Push, And The Upstream Branch — Advanced Git Internals & Distributed Workflows
- Fetch Is Not Pull — Advanced Git Internals & Distributed Workflows
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book