0

I've been doing a fair amount of research and can't find this trivial functionality:

git log and git show are only showing the headline/title of the commit message, but I'd like to see the rest of the body.

By body, I mean the section where 'conflicts' and 'squashed commits' are usually listed.

How can I view this information?

Thanks

neaumusic
  • 10,027
  • 9
  • 55
  • 83
  • 1
    I might have misunderstood you. When you create a commit, the Git-supplied template includes comments that, with default options, won't be included in the resulting commit message. To include them, you can either strip the comment leader (a leading `#` character cause git to ordinarily strip that line from the resulting message) or supply [an alternate message-cleanup option](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---cleanupltmodegt).Is this what you meant? – jthill Nov 05 '20 at 00:05
  • @jthill This is exactly the issue, I'm kinda embarrassed/not sure how to make this question helpful for people. Maybe an answer about enabling that by default could be useful. I assumed that section was similar to direct README.md commits on github where there's a body section, or I guess merges that I've seen include that by default – neaumusic Nov 05 '20 at 00:21

2 Answers2

1

When you create a commit, the Git-supplied template includes comments that, with default options, won't be included in the resulting commit message.

To include them, you can either strip the comment leader (a leading # character cause git to ordinarily strip that line from the resulting message) or supply an alternate message-cleanup option.

:%s,^#,,

is the vim command to strip the comment leaders.

jthill
  • 55,082
  • 5
  • 77
  • 137
0

After you squashed, actually you can't see the deleted commits. But I think it'll be a useful "git reflog" command. It shows the path of your head had been with hash codes.my experience in above command

Damika
  • 622
  • 2
  • 8
  • 17