在Android Studio上面直接操作Version Control的reword是最直接的。

    用git的方式来:

    1. git rebase -i HEAD~1

    打开了文本编辑器

    1. pick 10130de msg
    2. # Rebase da71f75..10130de onto da71f75 (1 command)
    3. #
    4. # Commands:
    5. # p, pick <commit> = use commit
    6. # r, reword <commit> = use commit, but edit the commit message
    7. # e, edit <commit> = use commit, but stop for amending
    8. # s, squash <commit> = use commit, but meld into previous commit
    9. # f, fixup <commit> = like "squash", but discard this commit's log message
    10. # x, exec <command> = run command (the rest of the line) using shell
    11. # d, drop <commit> = remove commit
    12. # l, label <label> = label current HEAD with a name
    13. # t, reset <label> = reset HEAD to a label
    14. # m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
    15. # . create a merge commit using the original merge commit's
    16. # . message (or the oneline, if no original merge commit was
    17. # . specified). Use -c <commit> to reword the commit message.
    18. #
    19. # These lines can be re-ordered; they are executed from top to bottom.
    20. #
    21. # If you remove a line here THAT COMMIT WILL BE LOST.
    22. #
    23. # However, if you remove everything, the rebase will be aborted.
    24. #
    25. #
    26. # Note that empty commits are commented out

    保存,关闭。
    git显示命令:

    1. $ git rebase -i HEAD~1
    2. hint: Waiting for your editor to close the file...

    然后打开了文本编辑器,显示的就是

    1. msg
    2. //提示信息

    这里把msg改成123456798,然后保存,关闭。

    1. $ git rebase -i HEAD~1
    2. [detached HEAD 951f653] 123456789
    3. Date: Fri Jul 20 15:26:26 2018 +0800
    4. 1 file changed, 0 insertions(+), 0 deletions(-)
    5. create mode 100644 新建文本文档.txt
    6. Successfully rebased and updated refs/heads/master.

    这个时候commit信息已经修改,并且也改了版本快照的hash值。