Delete multiple git remote tags and push once

后端 未结 5 1153
遇见更好的自我
遇见更好的自我 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:31

    I found an easy way to do this if you have grep and xargs installed. I am shamelessly taking this from https://gist.github.com/shsteimer/7257245.

    Delete all the remote tags with the pattern your looking for:

    git tag | grep  | xargs -n 1 -I% git push origin :refs/tags/%
    

    Delete all your local tags:

    git tag | xargs -n 1 -I% git tag -d %
    

    Fetch the remote tags which still remain:

    git fetch
    

提交回复
热议问题