On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
main.cpp
main.exe
nothing added to commit but untracked files present (use "git add" to track)
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: main.cpp
new file: main.exe
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: main.cpp
也就是说刚才我们通过 git add 将 main.cpp 和 main.exe 跟踪后,他们便是暂存的,你也可以看到在 git status 中也显示他们是 Changes to be committed,而我们又对 main.cpp 做了修改,这时候这个修改便没有被暂存,git status 显示其为 Changes not staged for commit。
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: main.cpp
no changes added to commit (use "git add" and/or "git commit -a")
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
nothing added to commit but untracked files present (use "git add" to track)
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
nothing added to commit but untracked files present (use "git add" to track)