$ git --version
git version 2.5.3
$ git branch
* feature/branchABC
$ git status -b branchABC
On branch feature/branchABC
Your branch is up-to-date with 'origin/feature/branchABC'.
nothing to commit, working directory clean
$ echo "abc" > abc.cpp
$ git status -b branchABC
On branch feature/branchABC
Your branch is up-to-date with 'origin/feature/branchABC'.
nothing to commit, working directory clean
问题> 在当前文件夹中添加了一个新的文件abc.cpp
,为什么在git中仍然显示“工作目录干净”?
谢谢
--更新一--
$ git status
On branch feature/branchABC
Your branch is up-to-date with 'origin/feature/branchABC'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
abc.cpp
nothing added to commit but untracked files present (use "git add" to track)
git status
命令简单地列出当前工作目录下 Git 仓库中的更改情况,不带-b
参数。 - Makotogit status
显示了未跟踪的文件。 - q0987