インタラクティブrebase(git rebase -i)を使うと、commitを書き換え、並べ替え、結合、編集、削除でき、共有する前にcommit履歴を整理できます。これは雑然とした作業中のcommitから、きれいで論理的な履歴を作り上げるための強力なツールです。
インタラクティブrebaseの開始
git rebase -i HEAD~4 # interactively rebase the last 4 commits
git rebase -i <commit> # rebase commits after <commit>
# → opens an editor listing the commits with actions to apply
