Name

status

Synopsis

git status [path ...]

Check what would happen if you ran git commit. If paths are specified, check what would happen if you ran git commit paths.

Examples

To check the status of the current branch:

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be
committed)
#
#       modified:   test1.c
#       modified:   test2.c
#
no changes added to commit (use "git add" and/or "git
commit -a")

To see what would happen if you ran git commit test1.c:

$ git status test1.c
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   test1.c
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be
committed)
#
#       modified:   test2.c
#

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.