updated readme, added git tag script

This commit is contained in:
Michael Herman 2015-01-03 15:13:57 -07:00
parent 3fc2562dd4
commit a8023a0780
2 changed files with 17 additions and 1 deletions

14
22_git_tag.py Normal file
View File

@ -0,0 +1,14 @@
import subprocess
import sys
if len(sys.argv) == 3:
tag = sys.argv[1]
commit = sys.argv[2]
command = 'git tag -a {0} {1} -m "{2}"'.format(tag, commit, tag)
output = subprocess.check_output(command, shell=True).decode('utf-8')
subprocess.call(command, shell=True)
subprocess.call('git push --tags', shell=True)
else:
print 'usage: tag.py TAG_NAME COMMIT'
sys.exit(1)

View File

@ -19,4 +19,6 @@
1. **17_rewrite_git_history.md**: Backdating/Rewriting Git history (use at your own risk)
1. **18_zipper.py**: Zip contents of a directory, adding a timestamp to the filename
1. **19_tsv-to-csv.py**: Convert TSV to CSV
1. **20_restore_file_from_git.py**: Restore file from Git History
1. **20_restore_file_from_git.py**: Restore file from Git History
1. **21_twitter_bot.py**: Twitter Bot
1. **22_git_tag.py**: Create Git Tag based on a commit