git add only modified changes and ignore untracked files

Ideally your .gitignore should prevent the untracked (and ignored) files from being shown in status, added using git add etc. So I would ask you to correct your .gitignore

You can do git add -u so that it will stage the modified and deleted files.

You can also do git commit -a to commit only the modified and deleted files.

Note that if you have Git of version before 2.0 and used git add ., then you would need to use git add -u . (See “Difference of “git add -A” and “git add .“).

Leave a Comment