Skip to content

Instantly share code, notes, and snippets.

@artifactsauce
Created July 6, 2016 07:29
Show Gist options
  • Save artifactsauce/4230125a9410400e3c7ee2fbd34f9606 to your computer and use it in GitHub Desktop.
Save artifactsauce/4230125a9410400e3c7ee2fbd34f9606 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eu
LOGGER_LOG_LEVEL=4
BASE_DIR=$(pwd)
LIB_DIR=$HOME/src/github.com/artifactsauce/proglets/lib/bash
. $LIB_DIR/functions
. $LIB_DIR/logger
while read
do
[[ "$REPLY" =~ ^\# ]] && continue
BRANCH='feature/fix-bug'
logger.debug "Change the repository to $REPLY"
logger.debug "Change the beanch to $BRANCH"
cd $REPLY
git fetch -p
if [[ -n $(git branch | grep $BRANCH) ]]; then
git checkout $BRANCH
elif [[ -n $(git ls-remote origin | grep $BRANCH) ]]; then
git checkout -b $BRANCH origin/$BRANCH
else
# git checkout master
:
fi
git pull
# git push --set-upstream origin topic/fix-bug
cd $BASE_DIR
done <<EOS
bot
cookbook-h2o
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment