Last active
August 29, 2015 14:19
-
-
Save amandeepjutla/8d483f30d680e6cc68be to your computer and use it in GitHub Desktop.
Automated way to do basic things in an indelicate way. Useful if your needs are limited and you are the only person using a repository; probably worse than useless otherwise.
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/env python | |
# raleigh: a stupid git wrapper | |
import subprocess, sys | |
try: | |
if sys.argv[1].lower() == "local": | |
name = raw_input("Name of commit: ") | |
subprocess.call("git add .", shell=True) | |
subprocess.call("git commit -m " + "'" + name + "'", shell=True) | |
if sys.argv[1].lower() == "revert": | |
subprocess.call("git add . && git reset --hard HEAD", shell=True) | |
if sys.argv[1].lower() == "undo": | |
subprocess.call("git reset --hard HEAD^", shell=True) | |
subprocess.call("git push origin --force", shell=True) | |
if sys.argv[1].lower() == "history": | |
subprocess.call("git log -p", shell=True) | |
if sys.argv[1].lower() == "help": | |
print "\tno argument \tcommits changes, pushes remotely" | |
print "\tlocal \t\tcommits changes only" | |
print "\trevert \t\treverts to last commit" | |
print "\tundo \t\tundoes last commit locally and remotely" | |
print "\thistory \tshows patch history" | |
except: | |
name = raw_input("Name of commit: ") | |
subprocess.call("git add .", shell=True) | |
subprocess.call("git commit -m " + "'" + name + "'", shell=True) | |
subprocess.call("git push origin master", shell=True) | |
print "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment