Git status 命令

更新时间: 2019-07-13 17:17

查看当前版本状态(是否修改)

语法

git status [<options>...] [--] [<pathspec>...]

参数

-s, --short
    Give the output in the short-format.

-b, --branch
    Show the branch and tracking info even in short-format.

--show-stash
    Show the number of entries currently stashed away.

--porcelain[=<version>]
    Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git
    versions and regardless of user configuration. See below for details.

    The version parameter is used to specify the format version. This is optional and defaults to the original version v1 format.

--long
    Give the output in the long-format. This is the default.

-v, --verbose
    In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e., like
    the output of git diff --cached). If -v is specified twice, then also show the changes in the working tree that have not yet been
    staged (i.e., like the output of git diff).

-u[<mode>], --untracked-files[=<mode>]
    Show untracked files.

    The mode parameter is used to specify the handling of untracked files. It is optional: it defaults to all, and if specified, it
    must be stuck to the option (e.g.  -uno, but not -u no).

    The possible options are:

    o   no - Show no untracked files.

    o   normal - Shows untracked files and directories.

    o   all - Also shows individual files in untracked directories.

        When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal), to help you avoid
        forgetting to add newly created files. Because it takes extra work to find untracked files in the filesystem, this mode may
        take some time in a large working tree. Consider enabling untracked cache and split index if supported (see git update-index
        --untracked-cache and git update-index --split-index), Otherwise you can use no to have git status return more quickly without
        showing untracked files.

        The default can be changed using the status.showUntrackedFiles configuration variable documented in git-config(1).

--ignore-submodules[=<when>]
    Ignore changes to submodules when looking for changes. <when> can be either "none", "untracked", "dirty" or "all", which is the
    default. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs
    from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config(1) or
    gitmodules(5). When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are
    still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits
    stored in the superproject are shown (this was the behavior before 1.7.0). Using "all" hides all changes to submodules (and
    suppresses the output of submodule summaries when the config option status.submoduleSummary is set).

--ignored
    Show ignored files as well.

-z
    Terminate entries with NUL, instead of LF. This implies the --porcelain=v1 output format if no other format is given.

--column[=<options>], --no-column
    Display untracked files in columns. See configuration variable column.status for option syntax.--column and --no-column without
    options are equivalent to always and never respectively.

<pathspec>...
    See the pathspec entry in gitglossary(7).

使用示例

# 显示有变更的文件
$ git status

查看更多 git status 命令的使用方法,可以使用命令:

git help status
世界因你不同:李开复自传(纪念版)

世界因你不同:李开复自传(纪念版)

李开复,范海涛 著作 / 中信出版社 / 2015-7-10 / 39.00

编辑推荐 1.李开复唯一一部描写全面生平事迹的传记:《世界因你不同:李开复自传》书中讲述了家庭教育培育的“天才少年”;学校教育塑造的“创新青年”,走入世界顶级大公司,苹果、微软、谷歌等亲历的风云内幕,岁月30载不懈奋斗、追求事业成功的辉煌历程。 2.娓娓道来、字字珠玑、可读性和故事性皆佳。李开复博士是青少年成长成才的励志偶像,年轻家长、学校教师阅读后也能从中得到感悟和启发。 3.......一起来看看 《世界因你不同:李开复自传(纪念版)》 这本书的介绍吧!

在线进制转换器

在线进制转换器

各进制数互转换器

RGB HSV 转换

RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具