📅  最后修改于: 2023-12-03 15:15:18.734000             🧑  作者: Mango
In this article, we will explore the git status
command in the Shell-Bash environment. git status
is a popular and powerful command that allows programmers to view the current working tree status and changes in a Git repository. It provides valuable information about the state of your codebase and helps you keep track of your changes.
The basic syntax of the git status
command is as follows:
git status [options]
Here are some commonly used options with the git status
command:
-s
or --short
: Provides a short and concise output with status information.-u
or --untracked-files
: Shows untracked files in the output as well.-b
or --branch
: Displays the branch information and tracking status.-v
or --verbose
: Gives a more detailed output including additional information.git status
OutputRunning git status
without any options will display a summary of the current branch, along with information about modified, staged, and untracked files.
$ git status
Using the -s
or --short
option provides a more compact and easy-to-read output, showing the status of each file in a short format.
$ git status -s
The -v
or --verbose
option provides a more detailed output, including information about file modifications, additions, and deletions, along with the corresponding diff.
$ git status -v
To see the untracked files in addition to the modified and staged files, use the -u
or --untracked-files
option.
$ git status -u
By using the -b
or --branch
option, you can see the branch information and the status of the current branch.
$ git status -b
The git status
command is a fundamental tool for developers working with Git repositories. It provides an overview of the current state of your codebase, allowing you to track changes, identify modified files, and manage your workflow efficiently. Experiment with the various options to customize the output according to your needs and enhance your Git workflow.