diff options
Diffstat (limited to 'sh')
-rwxr-xr-x | sh/gitpu | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -1,19 +1,28 @@ #!/bin/sh +branch=master +while getopts b: opt; do + case $opt in + b) branch="$OPTARG";; + \?) exit 1;; + esac +done +shift $((OPTIND-1)) + if [ -z "$1" ]; then - git checkout master - git pull upstream master + git checkout "$branch" + git pull upstream "$branch" git push git checkout fly - git merge --no-edit master + git merge --no-edit "$branch" git push else for dir; do - git -C "$dir" checkout master - git -C "$dir" pull upstream master + git -C "$dir" checkout "$branch" + git -C "$dir" pull upstream "$branch" git -C "$dir" push git -C "$dir" checkout fly - git -C "$dir" merge --no-edit master + git -C "$dir" merge --no-edit "$branch" git -C "$dir" push done fi |