Delete multiple git remote tags and push once

后端 未结 5 1197
遇见更好的自我
遇见更好的自我 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条回答
  •  轮回少年
    2021-01-30 18:43

    To delete locally multiple tags: git tag:

    git tag -d ...

    So simply:

    git tag -d TAG1 TAG2 TAG3
    

    To delete multiple tags remotely: git push:

    git push [-d | --delete] [ [...]]

    So simply:

    git push ${REMOTE_NAME:-origin} --delete TAG1 TAG2 TAG3
    

    TL;DR:

    git tag -d TAG1 TAG2 TAG3
    git push origin -d TAG1 TAG2 TAG3
    

提交回复
热议问题