LoginSignup
1
1

More than 1 year has passed since last update.

Git | $ git rebase --interactive で 逆順に fixup / squash する

Last updated at Posted at 2016-06-08

問題

インタラクティブモードでリベースする時の話。

たとえば、こういうコミットがある場合。

pick 77335c9 Commit A
pick d850545 Commit B

BをAに溶かしたいんじゃなくて。

Commit A
⇡
Commit B

AをBに溶かしたい。

Commit A
↓
Commit B

解決

そんな時は、まずはテキストを上下に入れ替えてから。

pick d850545 Commit B
pick 77335c9 Commit A

次に fixup ( または squash ) を指定すれば良い。

pick 77335c9 Commit A
f d850545 Commit B

環境

  • git version 2.7.4 (Apple Git-66)

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

メンター受付

1
1
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
1
1