Skip to content

Instantly share code, notes, and snippets.

@simon2k
Forked from mamut/git-patchmaker.sh
Created October 15, 2013 07:18
Show Gist options
  • Save simon2k/6987769 to your computer and use it in GitHub Desktop.
Save simon2k/6987769 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
pivotal_ticket_id=$1
function commits_from_development() {
git checkout development > /dev/null 2>&1
git log --reverse --oneline --no-abbrev-commit --grep $1 | cut -d ' ' -f 1
}
function apply_on_master() {
git checkout master > /dev/null 2>&1
git cherry-pick $@
}
commits=$(commits_from_development $pivotal_ticket_id)
apply_on_master $commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment