Skip to content

Instantly share code, notes, and snippets.

@RaviH
Last active August 29, 2015 14:14
Show Gist options
  • Save RaviH/52ef842d46be481ca132 to your computer and use it in GitHub Desktop.
Save RaviH/52ef842d46be481ca132 to your computer and use it in GitHub Desktop.
Delete git tags from remote as well as local repo
__author__ = 'ravi'
from subprocess import call
import logging as log
import os
os.chdir('/home/ravi/dev/projects/spiderman')
for i in range(115, 280):
try:
# Remove locally
call(['git', 'tag', '-d', '1.0.{}'.format(i)])
except Exception as ex:
log.exception(ex)
pass
try:
# Remove from master
call(['git', 'push', 'origin', ':refs/tags/1.0.{}'.format(i)])
except Exception as ex:
log.exception(ex)
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment