Skip to content

Instantly share code, notes, and snippets.

@megazalrock
Last active December 19, 2015 19:48
Show Gist options
  • Save megazalrock/6008456 to your computer and use it in GitHub Desktop.
Save megazalrock/6008456 to your computer and use it in GitHub Desktop.
#!/bin/sh
#ブランチ名の取得
branch=$(git rev-parse --symbolic --abbrev-ref $1)
test_dir=$HOME/www/test.grandam.jp/html
product_dir=$HOME/www/grandam.jp/html
repo_dir=$HOME/git/grandam.git
#テスト環境に反映
if [ "$branch" = "master" ]
then
cd $test_dir
git --git-dir=.git pull $repo_dir master
fi
#本番環境に反映
if [ "$branch" = "product" ]
then
cd $product_dir
git --git-dir=.git pull $repo_dir product
fi
exec git update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment