如何在 PyCharm 中编辑提交消息? [英] How to edit a commit message in PyCharm?

查看:113
本文介绍了如何在 PyCharm 中编辑提交消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 git 中有一个命令 git commit --amend 来编辑你最后的提交信息.我一直在 pycharm 中寻找这种类型的功能,但似乎找不到.我用谷歌搜索,找不到任何东西.这在pycharm中存在吗?

In git there is a command git commit --amend to edit your last commit message. I was looking for this type of functionality in pycharm and can't seem to find it. I googled and couldn't find anything. Does this exist in pycharm?

推荐答案

我遇到了完全相同的问题,我认为我应该澄清并将所有上述对我有用的知识集中在一个地方:

I had the exact same issue and thought I should clarify and bring all the fore-mentioned knowledge that worked for me in one place:

从 VCS 中选择 Commit Changes,然后勾选 Amend commit",选择一个要提交的新更改并添加新的提交消息(以替换之前的提交之一).最后,选择提交.

From VCS select Commit Changes, then tick Amend commit", select a new change to be committed and add new commit message (to replace the one of the previous commit). Finally, select Commit.

按照 LazyOne 的评论,在 https://www.jetbrains.com/help/pycharm/2016.1/commit-changes-dialog.html 它解释了 Amend commit" 选项的工作原理.此外,正如 Liam Jones 明确指出的那样,您不仅必须勾选 Amend commit" 选项,还必须选择提交一些新的更改(任何小的更改就足够了),以便 底部的提交按钮变为可用.

Following LazyOne's comment, at https://www.jetbrains.com/help/pycharm/2016.1/commit-changes-dialog.html it explains how the Amend commit" option works. Furthermore, as it was clearly noted by Liam Jones, you must not only tick the Amend commit" option but also select to commit some new change (any small change would suffice) in order for the Commit button at the bottom to become available.

当您执行上述步骤时,这个新的提交连同之前提交的更改将使用最新的提交消息合并;换句话说,通过这种方式,您可以替换上次提交的提交消息.

When you do the above steps, then this new commit along with the changes of the previous commit will be merged using the latest commit message; in other words, this way you replace the commit message of your last commit.

当然,git commit --amend 选项(如此处所述https://git-scm.com/book/en/v2/Git-Basics-Undoing-Things) 可能是另一个(更干净)可以在 IDE 之外工作的人的方式.

Of course, the git commit --amend option (as described here https://git-scm.com/book/en/v2/Git-Basics-Undoing-Things) is perhaps another (cleaner) way for someone who can work outside of an IDE.

这篇关于如何在 PyCharm 中编辑提交消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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