【问题标题】:Intellij "before commit" options meaningIntellij“提交前”选项含义
【发布时间】:2015-06-30 03:46:48
【问题描述】:

我找不到关于提交时可见的几个选项(复选框)的文档。

我正在寻找一个选项来squash IDE 中的所有提交,我想知道这些选项中的一个是否无法帮助我做到这一点。有没有关于不同选项的官方文档?

【问题讨论】:

  • 不确定压缩,但这些选项激活/停用了here 中描述的一些代码检查任务 - 向下滚动到 提交前/提交前。也许想法文档中的Rebasing Commits Dialog 将对壁球选项有所帮助。
  • 我认为您不能使用这些操作来压缩提交。不过,IntelliJ 还有其他方法可以做到这一点。有关详细信息,请参阅此答案:stackoverflow.com/a/26904021/1291150
  • 谢谢,这两个答案都很有用,我找到了我想要的。 @Morfic如果您写答案,我会接受。 (因为你的答案就是问题所在)
  • 很高兴我能帮上忙,干杯!

标签: git intellij-idea git-squash


【解决方案1】:

以下是提交前操作的简要说明(source):

Operation Description
Reformat code Perform code formatting according to the Project Code Style settings.
Rearrange code Rearrange your code according to the arrangement rules preferences.
Optimize imports Remove redundant import statements.
Perform code analysis Perform code analysis Run code inspection on the files you are about to commit/shelve.
Check TODO (filter name) Review the TODO items matching the specified filter. Click Configure to choose an existing TODO filter, or open the TODO settings page and define a new filter to be applied.
Cleanup Automatically apply the current inspection profile to the files you are going to commit/shelve.
Update copyright Add or update a copyright notice according to the selected copyright profile - scope combination.

【讨论】:

    【解决方案2】:

    按照我原来的评论,我认为有两个不同的特点:

    1. 在提交前部分,详细描述here,提供了一些代码检查任务,Idea 将在实际提交之前在您的类上运行它们。根据他们的输出(例如:新的 TODO),有些人可能会要求确认您确实想要执行提交:

    1. squash 功能,我还不是很熟悉,也许可以从Rebasing Commits Dialog 访问

    【讨论】:

    • 您提供的链接中没有关于提交前操作的描述。也许他们已经移动了它。如果你复制/粘贴答案会好很多,所以它会留在这里。链接上的内容可以改变,链接可以死等
    猜你喜欢
    • 2022-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-31
    相关资源
    最近更新 更多