How can git bulk delete a remote tag

Source: Internet
Author: User

I used Google search how to delete git tags batch, found that the foreigner's saying is probably, bulk delete, haha, English not ah.

Nothing more than the shell of some practice, feel the actual use of enough.

The first is to find the remote to delete tags list, the key is to use the instructions.

Git show-ref--tag

This command lists all the remote tag lists, and then the general approach to the shell.

Git push Origin:<tag>

As above instructions, will cause the remote tag to be deleted. With a pipe connection, everything is fine.

Git show-ref--tag | awk '/(. *) (\s+) (. *) $/{print: ' $} ' | Xargs git push origin

The instructions above are stitching the complete instructions, but this command, will remove all the tags, caution, if you want to delete eligible, you should modify the AWK directive's regular expression.

Delete the end of the tag, the local tag, delete method is not too, but the same principle.

git tag | grep "v1.1.0.\d$" | Xargs git tag-d

For example, the above command deletes all local v1.1.0.x tag, which deletes up to 10 tags.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.