LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-rebase-patch

Rebase with patch application

TLDR

Rebase and apply patch
$ git rebase-patch [patch_file]
copy

SYNOPSIS

git rebase-patch patchfile_

DESCRIPTION

git rebase-patch finds where an old patch file still applies and replays it onto the current HEAD. This git-extras command is for patches that no longer apply cleanly to HEAD: it walks backward through parent commits, testing the patch against each historical tree with a temporary index, until it finds one it applies to. It then manufactures a commit there and cherry-picks it forward onto the current branch.This is useful for reviving an old, bit-rotted patch without manually figuring out which commit it was written against.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Part of git-extras package. Only searches back along the first-parent chain from HEAD; if the patch was based on a commit outside that chain, it will not be found.

SEE ALSO

RESOURCES

Copied to clipboard
Kai