git pull 一键拉取代码脚本
#!/bin/bash echo "loading..." cd /www/dev/api/testproject #没有提交的修改暂存到stash里面 git stash curr_branch=$(git symbolic-ref --short -q HEAD) pub_branch="dev-common" if [ ${curr_branch} != ${pub_branch} ]; then git checkout ${pub_branch} fi git pull #php /www/dev/api/testproject/init --env=Development --overwrite=all #projectArr=("testproject1" "testproject2") #pub_branch="build-dev" #for project in ${projectArr[@]} #do # echo "....................loading $project...................." # cd /www/$project # # curr_branch=$(git symbolic-ref --short -q HEAD) # # if [ ${curr_branch} != ${pub_branch} ]; then # git checkout ${pub_branch} # fi # git pull #done