Skip to content

Instantly share code, notes, and snippets.

@svandragt
Last active October 29, 2019 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svandragt/adef075f069b33e972ddd0efd48c8107 to your computer and use it in GitHub Desktop.
Save svandragt/adef075f069b33e972ddd0efd48c8107 to your computer and use it in GitHub Desktop.
Git Helper
alias git-create="git-util.py $1 $2"
#!/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