Using IntelliJ to amend git commit message

前端 未结 9 991
我寻月下人不归
我寻月下人不归 2020-12-02 11:03

Can one amend a git commit message using IntelliJ, or should one resort to command line?

How can this be done please?

相关标签:
9条回答
  • 2020-12-02 11:14

    You can also go to your git folder with a terminal and shell like powershell, cmd or bash (depends on your system), and then type:

    git commit --amend -m "your new commit message"
    
    0 讨论(0)
  • 2020-12-02 11:14

    In the Log tab, select the commit and press F2 (Reword). Thats it.

    0 讨论(0)
  • 2020-12-02 11:19

    View => Tool Windows => Version Control. (Windows (Alt + 9) / OS X (Cmd + 9))

    IntelliJ 2017.1 and higher => Go to Log and right click + reword or press F2.

    While you are on the same branch, ( your checked out branch is the same )

    0 讨论(0)
  • 2020-12-02 11:23

    Amend is supported: invoke "Commit Changes" and select the checkbox "Amend commit" in the Commit Dialog. Then press "Commit" button, and the commit will be amended to the previous one.

    However, the support is limited:

    • you can't see the details of the commit being amended,
    • if you don't have any uncommitted changes (for example, you just want to change the message of the previous commit without adding more changes to it), you won't be able to invoke "Commit".
    0 讨论(0)
  • 2020-12-02 11:27

    In JetBrains Go to View -> Version Control -> This would open the version control log tab to the bottom of the screen Go to Log and you can see the commit that you did last Right click on it, and select undo commit

    Bingo! You have reverted all your commit and the message is erased. You can also choose to do soft reset in case you only want to change the commit mesage

    0 讨论(0)
  • 2020-12-02 11:28

    In case, 2018.3 and same with 2017.1

    Alt + 9 (version control window)

    And right click -> context menu click "Reword... F2 "

    OR

    shorcut F2 You can edit message.

    0 讨论(0)
提交回复
热议问题