23

I would like to git log --follow file.ext but showing all commits, including merges.

Tried no-max-parents, but not helping.

Moe Far
  • 2,742
  • 2
  • 23
  • 41
lajarre
  • 4,910
  • 6
  • 42
  • 69

1 Answers1

28

The -m will do the trick for you, log -m is for get into the merges.

git log -m --oneline --full-history --follow file.ext

This should follow the file in the Merges [-m].

And i assume you was aiming to use --min-parents=2 instead of no-max-parents. The --min-parents=2 is the same as --merged since it will return the commit with more then one parent.

You can always add some extra flags to display the results in a more friendly way:
git log -m --name-only --oneline --follow file.ext. It will display the results with the SHA-1 of the commits as well with the message

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • 3
    For me, `-m` adds a lot more merges than would be "natural". For example, `git log file.ext` shows 10 normal commits and 2 merge commits for me, `git log --follow -m file.ext` lists 10 normal commits and 30 (!!) merge commits. – Borek Bernard Jun 11 '19 at 20:01
  • @BorekBernard I find the documentation a bit unclear, but it sounds like the option `--simplify-merges` may be meant to help this: "Additional option to --full-history to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge." – Joshua Goldberg Aug 09 '19 at 20:03