Print commit message of a given commit in git

后端 未结 6 1945
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 10:10

I need a plumbing command to print the commit message of one given commit - nothing more, nothing less.

6条回答
  •  盖世英雄少女心
    2020-11-27 10:58

    Not plumbing, but I have these in my .gitconfig:

    lsum = log -n 1 --pretty=format:'%s'
    lmsg = log -n 1 --pretty=format:'%s%n%n%b'
    

    That's "last summary" and "last message". You can provide a commit to get the summary or message of that commit. (I'm using 1.7.0.5 so don't have %B.)

提交回复
热议问题