mdk
mdk copied to clipboard
Cross-repository cherry-pick
This is a similar feature to mdk backport, but I want it less magic, because that does a lot more than I want.
A common scenario is that I want to cherry-pick a commit from one repository to another. Usuually how I do this manually is:
1/ in repoA find the right commit git format-patch -n1 <hash>
into /tmp/
2/ In repoB git am /tmp/patch
3/ Get slightly annoyed with all the fiddling
What i'd like is to just do mdk cherry-pick repoA <hash>
There are a few different ways you could do this under the hood.
(Btw the reason I use /tmp is just that I get annoyed finding the path to the other repo)
I added a git alias to do this:
mdk-pick = "!sh -c 'git fetch `mdk info -v path $1` HEAD && git cherry-pick $2' -"