GIT list of new/modified/deleted files GIT list of new/modified/deleted files git git

GIT list of new/modified/deleted files


The best way to list these file is using git status --porcelain

For example:To remove previously deleted files:

git status --porcelain | awk 'match($1, "D"){print $2}' | xargs git rm


I'm not sure what you mean by with respect to each other, but if you want an individual listing (e.g. all modified files) you can use git ls-files with the right flags (for modified files it's -m). If you want all of this info at once, you can use git status --porcelain to get a script-parsable output of the status.


Use the dry-run (-n) option of git add:

git add -A -n