1

How do I use git log to show:

commit <hash id>
Author: <author info>
Date: <date info>

<commit message>

<files changed>

in the files changed section I also want to know how the file was changed. Either created, deleted, renamed, or modified.

git log -M --summary Shows created, deleted, or renamed type with file name next to the change. The result is missing modified files.

git log --name-only Shows all files changed, but now how they are changed

git log -p Shows all the changes in a file.

But how can I do something like git log -M --summary where it also shows if a file was modified?

This question addresses showing files that are added or moved.

Community
  • 1
  • 1
Whitecat
  • 3,882
  • 7
  • 48
  • 78
  • 3
    Perhaps you want `--name-status`? Note that `-M` by itself simply enables rename detection, which you can also do by setting your personal (`--global`) Git configuration (`git config --global diff.renames true`). Rename detection is now on by default in Git version 2.9 and higher. (You might also like `git log --raw`, which used to be known as `git whatchanged`.) – torek Jan 13 '17 at 02:01

1 Answers1

3

Not sure if that's what you want, but I once used the flag --name-status for something similar (not sure if it has changed since then). Here's the docs

pedrorijo91
  • 7,635
  • 9
  • 44
  • 82