LoginSignup
6
7

More than 3 years have passed since last update.

JetBrains IDEのVCSで複数のコミットログを一つにまとめる

Last updated at Posted at 2019-09-02

普段のコーディングでPRを出す前、乱雑に細分化したコミットログをある程度まとめたいときに使うJetBrains IDEの機能。

  1. "Version Control" - "Log" タブのソースツリーから、まとめたい対象の一番古いcommitを右クリック
    1.png

  2. "Interactively Rebase from Here"をクリック
    2.png

  3. 編集対象に対して"Action"を選んでいく(commitの順番は⇅で入れ替えられる)
    3.png

  4. 今回はcommitを結合したいので"Squash"を選択(一つ上のcommitに統合される)
    4.png

  5. コメントを編集して"Resume Rabasing"を押す。
    5.png

コンフリクトした場合は途中でマージモードに切り替わるので乱用は注意が必要。

Actionの種類はこんな感じ。
基本的に"Fixup"しか使わない。

Action Right align
Pick 選択したcommitをそのまま適用
Edit このcommitの影響を受けるファイルを編集してから適用
Skip commitを無視して、なかったことにする
Squash 選択したcommitを前のcommitと結合。
コメントも結合される。
Reword commitのcommentを編集してから適用
Fixup "Squash"のコメント破棄する版

公式
https://www.jetbrains.com/help/phpstorm/edit-project-history.html#interactive-rebase

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7