Display last git commit comment

前端 未结 10 679
南旧
南旧 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:09

    I just found out a workaround with shell by retrieving the previous command.

    Press Ctrl-R to bring up reverse search command:

    reverse-i-search

    Then start typing git commit -m, this will add this as search command, and this brings the previous git commit with its message:

    reverse-i-search`git commit -m`: git commit -m "message"
    

    Enter. That's it!

    (tested in Ubuntu shell)

提交回复
热议问题