Delete multiple git remote tags and push once

后端 未结 5 1156
遇见更好的自我
遇见更好的自我 2021-01-30 18:11

In Git, how can I delete multiple tags before pushing?

I know how to do it with one tag at a time. Not sure if it\'s possible to do multiple.

5条回答
  •  -上瘾入骨i
    2021-01-30 18:29

    It will delete all matching tag patterns.

    //Delete remote:
    git push -d origin $(git tag -l "tag_prefix*")
    
    // Delete local:
    git tag -d $(git tag -l "tag_prefix*")
    
    // Examples:
    git tag -d $(git tag -l "v1.0*")
    git push -d origin $(git tag -l "*v3.[2]*-beta*")
    

提交回复
热议问题