删除Git所有标签

xargs命令

1
2
3
4
5
[root@localhost ~]# echo "-lh" | cat
-lh
[root@localhost ~]# echo "-lh" | xargs ls
total 4.0K
-rw-------. 1 root root 1.5K Nov 14 2017 anaconda-ks.cfg

Remove all git tags

1
2
3
4
5
6
7
8
9
10
11
#Delete local tags.
git tag -l | xargs git tag -d

#Fetch remote tags.
git fetch

#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin

#Delete local tasg.
git tag -l | xargs git tag -d