mdk icon indicating copy to clipboard operation
mdk copied to clipboard

Cross-repository cherry-pick

Open danpoltawski opened this issue 10 years ago • 2 comments

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.

danpoltawski avatar Nov 18 '13 06:11 danpoltawski

(Btw the reason I use /tmp is just that I get annoyed finding the path to the other repo)

danpoltawski avatar Nov 18 '13 06:11 danpoltawski

I added a git alias to do this:

mdk-pick = "!sh -c 'git fetch `mdk info -v path $1` HEAD && git cherry-pick $2' -"

danpoltawski avatar Nov 18 '13 07:11 danpoltawski