A bash script that splits a git commit into multiple commits, one for each modified file.
Check out my blog or say hi on Twitter.
- Clone the repo
- (optional) Install git alias
./install-git-alias.sh
Although the second step is optional, it is strongly advised. You can use the script directly without installing the git alias, but git alias makes it much better.
To split a Git commit, run the git alias for the script with the hash of the commit to split as the only argument:
Usage: git split-commit <commit_hash> [options]
Options:
--no-push, -np Skips the offer to **force** push the original branch
--keep-temp-branch, -ktb Retains the temporary branch used to split the commit
--version, -v Prints the version of the script
--help, -h Prints this usage message
- Bartek Lipinski
Copyright 2023 Bartosz Lipiński
This script is licensed under the Mozilla Public License 2.0.