git status command
git status is a command used to view the current status of a Git repository.
git status The command can check whether files have been modified again since your last commit.
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached ..." to unstage)
new file: README
new file: hello.php
The git status command displays the following information:
- The name of the current branch.
- The relationship between the current branch and the remote branch (e.g., whether it is up to date).
- Unstaged changes: displays files that have been modified but not yet added to the staging area using
git add. - Untracked files: displays a list of new files not yet under version control.
Based on the output of git status, you can determine the status of files in the current working directory and take appropriate action.
Usually we use the -s parameter to get a short output result:
$ git status -s
AM README
A hello.php

The AM status means this file was modified again after we added it to the cache.
Git Basic Operations