Home > Software engineering >  Batch run for "git diff-tree"
Batch run for "git diff-tree"

Time:06-23

I need to find the changes made by each commit.

So I used git log to find the list of all commits.

Then I use git diff-tree current-commit previous-commit [some other options] to find the changes.

The problem is the repo has more than 3000 commits, so doing 3000 git diff-tree is quite time-consuming ?

Is it possible to do a single git diff-tree (fed by the list of all commits) to get all the changes.

CodePudding user response:

git log can print the diff of each listed commit (the diff is hidden by default, turn it on with the -p|--patch option), and can take all the options accepted by git diff (--name-only, --name-status, options for merge commits, ...)


@jthill's answer gives a set of options that basically outputs the same thing as git diff-tree for each commit.

You would have to describe in more details what information you are interested in if you want someone to provide you with a more suitable set of options.

CodePudding user response:

git log  -m --raw --no-abbrev --oneline --all

or if you want to get cute see git diff-tree's --stdin option.

  • Related