Skip to content

Instantly share code, notes, and snippets.

@mburgs
mburgs / gist:8850656
Last active August 29, 2015 13:56 — forked from odrotbohm/gist:3215345

Base off this gist: https://gist.github.com/olivergierke/3215345 a small extension to avoid writing the checkout command, we store the hash in a variable then checkout the other branch and proceed with the cherry-picking:

[alias]
  last = !git log -n 1 --pretty=format:%H $1
  cp-last-to = "!sh -c 'HASH=`git last` && git checkout \"$0\" && git cherry-pick $HASH'"

So you can just do: