Current Changes Status

We can observe the current status by using the git status command.

For example, when we run the git status command in a directory with changes, we will see he following result.

On branch master
Your branch is up-to-date with ‘origin/master’.

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:   app/assets/javascripts/application.js
    modified:   app/views/documents/_form.html.erb
    modified:   app/views/documents/show.html.erb

Untracked files:
  (use “git add <file>...” to include in what will be committed)

    app/assets/javascripts/components/last-save.js.jsx
    vendor/assets/javascripts/moment.js

For the status, you may observe that there are two stages of files: (Actually there are three, we will go through it later)

  1. Un-staged file changes, in red color.
  2. Staged file changes, in green color.

The third stage is committed file changes, which is stored as a snapshot in the git repository and hidden in the git status command.

Help message

In the git status, there are helping messages that guides you the next actions you can perform on those changes.

For example, it tells you that you can use add to stage the changes. And you can use checkout to un-stage the changes.

Short version

There is a short version of the status. If you are really familiar with the status output and what you can do with those changes, you can turn off all the unnecessary output by using the option --short, or -s.