|
|
#!/bin/env bash
|
|
|
|
|
|
DIRNAME=`dirname $0`
|
|
|
|
|
|
if [ "$1" == "" ]
|
|
|
then
|
|
|
echo "Il faut préciser un nom de branche !"
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
$DIRNAME/01_quick_commit.sh
|
|
|
|
|
|
courante=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | sed 's:(::g' | sed 's:)::g'`
|
|
|
if [ $courante != develop ]
|
|
|
then
|
|
|
echo "La branche actuelle n'est pas develop"
|
|
|
read -p "Voulez-vous basculer sur develop ? " -n 1 -r
|
|
|
echo # (optional) move to a new line
|
|
|
if [[ $REPLY =~ ^[YyOo]$ ]]
|
|
|
then
|
|
|
$DIRNAME/00_checkout_branch.sh develop
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
git branch $1
|
|
|
git checkout $1
|
|
|
git push --set-upstream all $1
|