Git status command is used to know the status of the working tree. It shows the state of your working directory and helps you see all the files which are untracked by Git, staged or unstaged. In other words, Git will show you any difference in the current tree and the HEAD pointer. It shows below details about the current branch

  • What branch you are currently on
  • Branch is up-to-date with the origin
  • Any unstaged changes
  • Any changes in your staging index that are ready to be committed
  • Any changes that have been committed but not merged

 

Usage

git status

List which files are staged, unstaged, and untracked. Sample output showing the three main categories of a git status call is included below:

# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
#modified: hello.py
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
#modified: main.py
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
#hello.pyc