How to change a past git commit+push message in RubyMine?

这一生的挚爱 提交于 2019-12-06 20:02:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!