Skip to content

Instantly share code, notes, and snippets.

@turnipsoup
Created May 17, 2018 22:05
Show Gist options
  • Save turnipsoup/6b0b9da3ecd3de2bf0711e59b8691f76 to your computer and use it in GitHub Desktop.
Save turnipsoup/6b0b9da3ecd3de2bf0711e59b8691f76 to your computer and use it in GitHub Desktop.
auto git stuff
#!/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