core code
currentBranch=$(git branch --show-current)
git add .
git commit -m "buildVersion${get_current_build_veresion}"
git push -u origin ${currentBranch}
full command
#!/bin/bash -l
# 设置utf8编码
#获取当前版本号
get_build_version=`xcodebuild -showBuildSettings -target ${APP_NAME} | grep CURRENT_PROJECT_VERSION | tr -d 'CURRENT_PROJECT_VERSION = '`
old_build_version=$get_build_version
echo "old_build_version = $old_build_version"
#版本号增加
agvtool new-version $(($old_build_version+1))
#输出新版本号
get_current_build_veresion=`xcodebuild -showBuildSettings -target ${APP_NAME} | grep CURRENT_PROJECT_VERSION | tr -d 'CURRENT_PROJECT_VERSION = '`
current_build_veresion=$get_current_build_veresion
echo "current_build_veresion = $current_build_veresion"
currentBranch=$(git branch --show-current)
git add .
git commit -m "buildVersion${get_current_build_veresion}"
git push -u origin ${currentBranch}