Split Patch Save

Split your patch similarly to `git add -p` but supporting multiple buckets

Project README

split-patch.py

asciicast

This is git add -p on steroids for patches.

Given a my.patch you can run

./split-patch.py my.patch

You can choose in which bucket to put each hunk.

At any moment, you can quit and my.patch will contain unassigned hunks while all the other hunks will be moved to $BUCKET_NAME.patch.

git-split-commit

The git-split-commit command uses split-patch.py to split the HEAD commit in multiple commits.

# Create backup tag
git tag backup-$(date +'%s')

# Split HEAD
./git-split-commit

By default, it first git revert HEAD and then commit all the patches resulting from the split.

If you don't care about the original commit + revert commit pair, you can run:

./git-split-commit --reset

Usage in interactive rebase

You can use git-split-commit during interactive rebase, assuming you have it in $PATH:

git rebase -i HEAD^^^^

Your $EDITOR will pop up with a series of pick commands. After the commit you want to split add:

exec git split-commit
Open Source Agenda is not affiliated with "Split Patch" Project. README Source: aleclearmind/split-patch
Stars
102
Open Issues
1
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating