summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh')
-rwxr-xr-xsh/gitpu21
1 files changed, 15 insertions, 6 deletions
diff --git a/sh/gitpu b/sh/gitpu
index 5453fae..d483add 100755
--- a/sh/gitpu
+++ b/sh/gitpu
@@ -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