Display last git commit comment

前端 未结 10 691
南旧
南旧 2020-12-02 03:36

Often during a commit ($ git -commit -m \"\"), I wish to read my last comment to remember what progress I have made. Is there an easy way to directly access the

10条回答
  •  天涯浪人
    2020-12-02 04:29

    To start with git log -1 --pretty='%s'

    But the below one covers all the cases,

    git log --pretty='format:%Creset%s' --no-merges -1

    • No unwanted white spaces
    • Discards merge commits
    • No commit id, date, Displays only the messages.

    Paste & see for yourself

提交回复
热议问题