Is there a way to get the list of all new/deleted/modified directories/files in local/remote repository w.r.t each other in GIT ?
To find out which files changed in a given commit, use the git log --raw command.
Listing all the deleted files in all of git history can be done by combining git log with --diff-filter . The log gives you lots of options to show different bits of information about the commit that happened at that point.
git show --name-only SHA1 . you can also do: git diff --name-only HEAD@{3} HEAD@{0} for the exact commits you want to compare.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With