Git Status – Show The Working Tree Status – POFTUT

Git Status – Show The Working Tree Status


The git status command is used to display the state of the current working directory and staging area. git status command will list staged changes, current changes. It will not list any history related information.

List Tracked and Untracked Files

We will start with a simple git status usage. We do not provide any option. This will list tracked and untracked files in a git repository.

$ git status
List Tracked and Untracked Files
List Tracked and Untracked Files

We can see that files named extension.c, pass.c, and pass2.c are not tracked by the git repository. All other files are tracked and their names are not listed.

Show In Short Format

If we want to just list the tracked and untracked files and folders in a short form we can use -s. As we can see below only the file and folder and status will be listed. ?? means untracked.

$ git status -s
Show In Short Format
Show In Short Format

From the output, we can see that only untracked file names are listed.

Show Branch Status

If we want to print also the branch status we can provide -b option like below.

$ git status -b
Show Branch Status
Show Branch Status

Verbose Status

We can also list current tracked and untracked files and folders in a verbose mode. We will use -v option.

$ git status -v

LEARN MORE  Git - Environment Setup and Basic Configuration

Leave a Comment