File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ import subprocess
2
+ import sys
3
+
4
+
5
+ if len (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 )
Original file line number Diff line number Diff line change 19
19
1 . ** 17_rewrite_git_history.md** : Backdating/Rewriting Git history (use at your own risk)
20
20
1 . ** 18_zipper.py** : Zip contents of a directory, adding a timestamp to the filename
21
21
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
You can’t perform that action at this time.
0 commit comments