如何在RubyMine中更改过去的git commit + push消息? [英] How to change a past git commit+push message in RubyMine?

查看:78
本文介绍了如何在RubyMine中更改过去的git commit + push消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心给出了一个错误消息,并使用RubyMine推送了一个提交.有什么办法可以纠正它?最好使用RubyMine方式,不要弄乱git,但也欢迎其他受信任的方式.

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.

推荐答案

正如您所说,您已经推送了,因此最好不要更改提交消息.原因是提交将获得另一个哈希值,这使git认为您已经推送的提交与更改了提交消息的提交是不同的.那很不好!您可以使用git push -f强制推送,如果您是一个人工作绝对可以,但是如果您是团队工作,我建议您不要更改该提交消息.

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?

这篇关于如何在RubyMine中更改过去的git commit + push消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆