我运行了“ git status”,下面列出了一些已修改的文件/或在“未暂存提交的更改”标题下。它还列出了一些我想忽略的未跟踪文件(这些目录中有一个“ .gitignore”文件)。 我想将已修改的文件放在暂存中,以便我可以提交它们。当我运行“ git add。”时,它添加了修改后的文件以及我要忽略的文件。 如果显示以下git状态,我如何仅添加修改后的文件而忽略未跟踪的文件。 另外,我的“ .gitignore”文件是否正常工作? $ git status # On branch addLocation # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: someProject/path/domain/viewer/LocationDO.java …