git标签相关处理脚本

if [ -z $2 ]; then
	echo "Fail:  You must specify one parameter!"
	echo "Example:  tag.sh delect origin tag_name"
	echo "or:  tag.sh delect tag_name"
	echo "or:  tag.sh add tag_name tag_log"
	exit 1
fi
if [ "$1" = "delect" ]; then
	if [ -n "$3" ]; then
		echo "Delect tag $2 $3"
		git push $2 :refs/tags/$3 
	else
		echo "Delect tag $2"
		git tag -d $2
	fi
fi
if [ "$1" = "add" ]; then
	echo "Add tag"
	if [ -n "$3" ]; then
		git tag -a $2 -m "$3"
	fi
	#echo "Add tag success"
fi
if [ "$1" = "push" ]; then
	echo "Push tag"
	if [ -n "$3" ]; then
		git push $2 $3
	fi
	#echo "Push tag success"
fi
发布了148 篇原创文章 · 获赞 72 · 访问量 71万+

猜你喜欢

转载自blog.csdn.net/u010406724/article/details/86495849