我运行了“gitstatus”,下面列出了一些修改/或标题为“未提交的更改”的文件。它还列出了一些我想忽略的未跟踪文件(我在这些目录中有一个“.gitignore”文件)。
我想将修改后的文件放到暂存中,以便提交它们。当我运行“gitadd.”时,它将修改后的文件和我想忽略的文件添加到暂存中。
如果出现下面的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
# modified: someProject/path/service/ld/LdService.java
# modified: someProject/path/service/ld/LdServiceImpl.java
# modified: someProject/path/web/jsf/viewer/LocationFormAction.java
# modified: someProject/war/WEB-INF/classes/message/viewer/viewer.properties
# modified: someProject/war/page/viewer/searchForm.xhtml
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .metadata/
# someProject/build/
no changes added to commit (use "git add" and/or "git commit -a")