Home > Back-end >  Change commit message in intellij after push
Change commit message in intellij after push

Time:01-07

I pushed my git commit and realised the commit message is incorrect. How can I change the commit message from Intellij? I am the only one using the remote feature branch with this commit. What are the drawbacks of doing this?

CodePudding user response:

You can use Edit commit message action in Git Log in IDE as mentioned here: enter image description here

CodePudding user response:

Let's suppose you did your first commit already and you want to change. Simply open the terminal inside Intellij.

First check your commit by typing:

git log --oneline

after, if you decide to change your commit, you simply type:

git commit --amend -m "new commit that overrides first commit"

you can again check your commit by typing git log --oneline and if you are okay with everything, you can push it to the remote repo.

  •  Tags:  
  • Related