dotfiles/.local/bin/scripts/git-cherry-get

5 lines
253 B
Bash
Executable File

#!/bin/sh -e
# Pick commit $2 (or HEAD) from the given git repository
# https://stackoverflow.com/questions/5120038/is-it-possible-to-cherry-pick-a-commit-from-another-git-repository
git "--git-dir=$1/.git" format-patch -k -1 --stdout $2 | git am -3 -k