LoginSignup
2
3

More than 5 years have passed since last update.

間に挟まってる過去のコミットを分割する

Posted at

こんな状態だとして、

$ g hist -4
* \c755efd 2015-04-14 | yellow (HEAD, feature/10) [toshi0383]\
* \ae8bf80 2015-04-14 | hello [toshi0383]\

helloを2つに分けます。

$ git rebase -i HEAD~~   # pick your commit
$ git reset --soft HEAD^
$ git reset -p           # unstage
$ git commit -m "hello1"
$ git add -p             # stage
$ git commit -m "hello2"
$ git rebase --continue

rebase -i で過去に戻って、コミットをキャンセルしてコミットし直してrebase --continue したらできました。

2
3
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
2
3