Created
February 4, 2014 02:40
Revisions
-
fkei created this gist
Feb 4, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,71 @@ #!/bin/bash # # git-feature-start - Git リポジトリディレクトリで、指定したブランチ名でブランチを作成し、合わせてリモートブランチも作成するコマンド # pushd `dirname $0` >/dev/null 2>&1 [ $? -eq 1 ] && exit 1 __script_dir=`pwd` popd >/dev/null 2>&1 __base_dir=`dirname ${__script_dir}` __dir=`pwd` echo "==========" echo " ____ _ _ _____ _ " echo " / ___(_) |_ | ___|__ __ _| |_ _ _ _ __ ___ " echo "| | _| | __| | |_ / _ \/ _\` | __| | | | '__/ _ \ " echo "| |_| | | |_ | _| __/ (_| | |_| |_| | | | __/ " echo " \____|_|\__| |_| \___|\__,_|\__|\__,_|_| \___| " echo "" echo ">> Start!! Directory: $__dir" if [ ! -d ".git" ]; then echo "[ERROR] Not a Git repository." exit 1 fi echo -n ">> Branch Name: " read name echo "" # init echo ">> State of the branch" git branch -a echo "" echo ">> git checkout develop" git checkout develop echo "" echo ">> git pull --all" git pull --all echo "" echo -n ">> Do you want to run? [y|n]" read run echo "" if [ "x$run" != "xy" ]; then echo "Treatment interruption" exit 1 fi echo "git branch $name" git branch $name echo "" echo "git checkout $name" git checkout $name echo "" echo ">> push remote ripository" echo "git push origin $name" git push origin $name echo "" echo "Finish!!!!!!!!!!"