如何暂存所有跟踪的修改文件?

Adi*_*rma 4 java git terminal github intellij-idea

好吧,这可能是一个愚蠢的问题,但我是 git 的新手,并且经常感到困惑。

我已经在 IntelliJ 上创建了一些文件,现在当我git status在 IntelliJ 终端中运行时,我得到以下信息:

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)

  new file:  file x
  new file:  file y
  new file:  file z

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: file x
 Modified: file y
 Modified: file z

Untracked files:
  (use "git add <file>..." to include in what will be committed) 

  file a 
  file b
Run Code Online (Sandbox Code Playgroud)

我想暂存并提交文件 x、文件 y、文件 z,但不想暂存文件 a 和文件 b。

我知道git add .将暂存所有跟踪和未跟踪的文件。类似的东西可以git add -u完成这项工作吗?

注意:文件很多,我不想单独添加它们。

Adi*_*l B 7

是 -git add -u当您希望 Git 暂存对其当前在整个存储库中跟踪的文件的所有修改时,请使用该命令。