Remix.run Logo
pajko an hour ago

Why isn't the 'edit' command mentioned? It's one of the most useful features. It can be used for splitting commits, for example. Mark the commit you want to split to be edited. The commit replay is going to stop after that commit. Now:

  git reset HEAD^1 (NO --hard!)
  git commit --patch ...
  git rebase --continue
You want to add some pending changes to the previous commit? No problem:

  git commit --patch --amend ...
You want to move the pending changes to future commits?

  git stash
  git rebase --continue
  git stash pop