Created
May 17, 2018 22:05
-
-
Save turnipsoup/6b0b9da3ecd3de2bf0711e59b8691f76 to your computer and use it in GitHub Desktop.
auto git stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
from sys import argv | |
import subprocess | |
try: | |
fileName = argv[0] | |
firstArg = argv[1] | |
secondArg = argv[2] | |
thirdArg = argv[3] | |
if firstArg == '-a': | |
subprocess.call(['git', 'add', '--all']) | |
subprocess.call(['git', 'commit', '-m', thirdArg]) | |
subprocess.call(['git', 'push', 'origin', secondArg]) | |
else: | |
subprocess.call(['git', 'add', firstArg]) | |
subprocess.call(['git', 'commit', '-m', thirdArg]) | |
subprocess.call(['git', 'push', 'origin', secondArg]) | |
except: | |
print() | |
print('=====HELP=====') | |
print() | |
print('Command Structure: ') | |
print('git.py [-a/filename] [branch] [message]') | |
print("example: git.py -a master 'uploading test README'") | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment