Quickfix allows you to commit changes in your git repository to a new branch without leaving the current branch.
I have often written a patch for some minor blemish that caught my attention. I found it annoying to have to stage my main changes, switch to a new branch created off the main branch, commit and push the patch and then switch back to the original branch.
git quickfix --push <new_branch>
<new_branch>
based-off origin/main
(or whatever the remote default branch is).--push
if you do not want to push the new branch to origin.git quickfix --help
provides more options.
--onto <branch>
you can modify the branch from which <new_branch>
is based-off.--keep
you can keep the last commit on the current branch.--keep
is not given, the commit will be removed from the current
branch. This is only safely possible if there are no local modifications.
Add --stash
if you have local changes that you want to temporarily stash.The cherry-pick is done in memory. This means your working directory will not be
modified. Unless --keep
is provided, the quickfix commit will be removed.
You can use Cargo to install quickfix.
shell
cargo install git-quickfix
Default branches from origin are picked up through a hard-coded list. Patches welcome. If the default branch on the remote is not called main, master or devel, you have to supply it manually. Similarly, if the remote is not called 'origin' similar issues will occur. Please create an issue if this bothers you.
Won't fix: --push
use the shell to push the changes. Benefits: All proxy,
auth and other configs are picked up. But if does not feel right.