LoginSignup
8
2

More than 5 years have passed since last update.

gitのタグを一括削除する

Last updated at Posted at 2017-09-22

タグ一覧を取得

terminal
git tag --list

grepでマッチしたリモートのタグを全て削除する

terminal
git tag | grep "hotfix_" | awk {'print ":" $1'} | xargs git push origin

例)「hoge」タグ以外のリモートのタグを全て削除する

terminal
git tag | grep -v "hoge" | awk {'print ":" $1'} | xargs git push origin

リモートのタグを削除しても、だれかがローカルのタグをPUSHしてしまうと
タグが復活してしまうので

「みなさんフェッチしてくださ~い!!」
と声をかける必要がある。(なんとめんどくさい...)


fetch.png


なにか他にいい方法あるんですかね。


8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2