Application 2021-10-05

Git Commit Split: Shell Command Quick Reference

Quick reference shell commands for splitting a Git commit using interactive rebase, reset, and staged re-commits for granular commit history.

Read in: ja
Git Commit Split: Shell Command Quick Reference

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
Tags: Git
Share: 𝕏 Post Facebook Hatena
✏️ View source / Discuss on GitHub
☕ Support

If you enjoy this blog, consider supporting it. Every bit helps keep it running!


Related Articles