Skip to content

Commit a8023a0

Browse files
committed
updated readme, added git tag script
1 parent 3fc2562 commit a8023a0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎22_git_tag.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
importsubprocess
2+
importsys
3+
4+
5+
iflen(sys.argv) ==3:
6+
tag=sys.argv[1]
7+
commit=sys.argv[2]
8+
command='git tag -a{0}{1} -m "{2}"'.format(tag, commit, tag)
9+
output=subprocess.check_output(command, shell=True).decode('utf-8')
10+
subprocess.call(command, shell=True)
11+
subprocess.call('git push --tags', shell=True)
12+
else:
13+
print'usage: tag.py TAG_NAME COMMIT'
14+
sys.exit(1)

‎readme.md‎

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

0 commit comments

Comments
(0)