查看当前状态

打印出当前工作树的状态。

  • 使用 git status 命令来查看当前工作树的状态。
  • 你可以选择添加 -sb 标志来查看相同输出的简短形式。
git status [-sb]

# 示例
git status
# On branch patch-1
# Your branch is up to date with 'origin/patch-1'.
#
# Untracked files:
#  (use "git add <file>..." to include in what will be committed)
#  30-seconds.txt
#
# nothing added to commit but untracked files present (use "git add" to track)

git status -sb
# ## patch-1...origin/patch-1
# ?? 30-seconds.txt