Last active
October 29, 2019 09:58
-
-
Save svandragt/adef075f069b33e972ddd0efd48c8107 to your computer and use it in GitHub Desktop.
Git Helper
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
alias git-create="git-util.py $1 $2" |
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 python3 | |
import sys | |
import subprocess | |
import shlex | |
if __name__ == '__main__': | |
args = sys.argv | |
command = args[1] | |
# simpler git-create branch feature/myfeature | |
if command == 'branch': | |
branch_name = args[2] | |
cmd = shlex.split(f'git checkout -b {branch_name} && git push -u origin {branch_name}') | |
subprocess.run(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment