git Clone所有分支到本地

源地址:https://blog.csdn.net/allanGold/article/details/78028709

逐一执行以下命令:

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all

git操作文档:http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches

 

git拉取所有tag信息到本地

# 拉取分支上现有的tags
git fetch --tags

#所有tag列表
git tag -l -n

# 推送所有tag到服务端
git push --tags

补充:

echo -e "${tagList}"

#获取最新版本tag

LatestTag=$(git describe --tags `git rev-list --tags --max-count=1`)

 

echo -e "最新版本tag......"
echo -e "$LatestTag"

 

echo -e "请输入要新增的版本号...... 如 v1.0.1"

#输入tag名称

read tagName

 

git tag ${tagName}

#推到分支上

git push origin ${tagName}
 
posted @ 2021-07-20 15:12  杏仁拌饭  阅读(408)  评论(0)    收藏  举报