Tracking file status changes in a Git log
I’m writing a program that consumes
git log output to walk a repository’s history, and I want to know when files are added, deleted, copies, moved, or modified.
git log --numstat is a straightforward way to see modifications, copies, and renames, but it doesn’t provide a good way to differentiate added or deleted files from modifications. (When a file is added,
numstat just shows as many lines added as there are in the file, and when one is deleted, as many lines removed.)
Reading the patch headers generated by
git log -p gives me this information, but I don’t care about the actual patch. Is there some way to only show the patch headers, or something similar?
- git log decoration origin/HEAD
- Is there an easy way to get a git reverse log starting from a given commit?
- SourceTree (Git) Relative Date Format?
- How can I access the information shown in git log --stat using only plumbing commands?
- Git: Equivalent of `--full-history` for `git bisect` and `git blame`
- Git: how to analyze code that has a multi-file history?
One Solution collect form web for “Tracking file status changes in a Git log”
git log –name-status
--name-status Show only names and status of changed files. See the description of the --diff-filter option on what the status letters mean.