Git Status – Show The Working Tree Status
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
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 Branch Status
If we want to print also the branch status we can provide
-b option like below.
$ git status -b
We can also list current tracked and untracked files and folders in a verbose mode. We will use
$ git status -v