Last active
January 5, 2016 01:25
-
-
Save spalger/d07decea6a155e77cf6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# call this with the pr number you want to apply and the base branch of that pr | |
# | |
# backport pr 5805, which was submitted against master, to 4.4: | |
# git co 4.4 | |
# git cherry-pick-pr 5805 | |
# | |
# backport pr 5840, which was submitted against 4.x, to 4.4: | |
# git co 4.4 | |
# git cherry-pick-pr 5840 4.x | |
# | |
#!/usr/bin/env bash | |
set -e | |
num="$1" | |
baseBranch="${2-master}" | |
# fetch the latest version of pr $num | |
git fetch -q upstream pull/$num/head | |
git cherry-pick -x "$baseBranch..FETCH_HEAD" --allow-empty-message --allow-empty | |
# after this is complete you can simply push the target branch to upstream |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment