Last active
December 21, 2015 17:58
-
-
Save mamut/6343660 to your computer and use it in GitHub Desktop.
`./git-patchmaker.sh 123456` will `git cherry-pick` all commits from master related to pivotal ticket #123456 to a stage branch
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
#!/bin/bash | |
set -e | |
pivotal_ticket_id=$1 | |
function commits_from_master() { | |
git checkout master > /dev/null 2>&1 | |
git log --reverse --oneline --no-abbrev-commit --grep $1 | cut -d ' ' -f 1 | |
} | |
function apply_on_stage() { | |
git checkout stage > /dev/null 2>&1 | |
git cherry-pick $@ | |
} | |
commits=$(commits_from_master $pivotal_ticket_id) | |
apply_on_stage $commits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment