This article was originally published on bmf-tech.com.
Notes on how to split a commit in Git. Occasionally needed.
// Specify the point to split. Edit the target commit.
git rebase -i HEAD~5
// The target commit is unstaged
git reset HEAD~
// Add & commit at any granularity
git add ~
git commit ~
git rebase --continue
Top comments (0)