提交错了 git 标签

image

因为需要将 FastAdmin 适配 php8,对 FastAdmin使用到的 think-captcha 做了一下更新。

不过在打了标签后发现把没有用到的 tag (v2 v3)也给提交到了仓库中。

如果一个一个手工在网页端删除太慢了,所以就找到了一下相关的命令,这里记录一下。

git show-ref --tag | awk '/v2\.[0-9]{1}[0-9]{0,}\.[0-9]{1}[0-9]{0,}$/ {print ":" $2}' | xargs git push origin

然后再删除本地的标签,防止下次又推送上去了。

git tag | grep "v2.*" | xargs git tag -d

出现一个小插曲,sourcetree 如果先删除本地的,一会儿就自动才远程更新回来了,这就比较尴尬了。

参考资料
https://www.cnblogs.com/joshua317/p/11089060.html

posted on 2023-07-16 19:47  建伟F4nniu  阅读(22)  评论(0编辑  收藏  举报

导航