问题
I accidentally gave a wrong message and pushed a commit with it using RubyMine. Is there any way I can correct it? RubyMine way would be preferred not to mess up git, but other trusted ways are also welcome.
回答1:
As you said, you already pushed, so it's wise not to change the commit message. The reason for that is that the commit will get another hash which makes git think that the commit you already pushed and the commit whose commit message you changed are different. That is bad! You can force push with git push -f
and that's absolutely okay if you are working alone, but if you are working in team, I suggest you not to change that commit message.
For anything else, take a look here: How to modify existing, unpushed commits?
来源:https://stackoverflow.com/questions/15863269/how-to-change-a-past-git-commitpush-message-in-rubymine