如何打tag3

#函数功能:git库打标签
function make_git_tag()
{
if [ "NULL" != $BRANCH_NAME ];then
run_cmd "git checkout $BRANCH_NAME"
fi

run_cmd "git tag -a $TAG_NAME -m "$TAG_NAME""
local REMOTE_NAME=`git remote show`
run_cmd "git push $REMOTE_NAME --tags"
}




########################################  main program start ##########################################




if [ $# != 3 ];then
echo "[$0,Line:$LINENO] Error: The Number of parameter is incorrect"
exit 1
fi




REPOSITORY_LOCAL_PATH=$1
TAG_NAME=$2
BRANCH_NAME=$3
pushd $REPOSITORY_LOCAL_PATH
if [ -d ".repo" ];then
make_repo_tag
popd
elif [ -d ".git" ];then
make_git_tag 
popd
else
echo "[$0,Line:$LINENO] Error: The Path has not a .git or .repo!"
exit 1
fi




########################################  main program end ##########################################
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值