rebase 編rebase は、一言でいうと、コミットの整理整頓ができます。
コミットを統合する (まとめる)例えば、以下のようなコミットが入っているとします $ git log --oneline 0d4a808 pullの説明を追加 9a54fd4 commitの説明を追加 ・・・・ 上記の2つのコミットをまとめるには、rebase -i を使います
テキストエディタが開いて、HEAD から HEAD^^ までのコミットが以下のように表示されます。 pick 9a54fd4 commitの説明を追加 pick 0d4a808 pullの説明を追加 # Rebase 326fc9f..0d4a808 onto d286baa # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. #
コミットメッセージを変更する
|