Skip to content

Instantly share code, notes, and snippets.

@stilliard
Last active June 7, 2018 01:21
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 stilliard/7734f83d63dfcb08021a22522b60d14e to your computer and use it in GitHub Desktop.
Save stilliard/7734f83d63dfcb08021a22522b60d14e to your computer and use it in GitHub Desktop.
git alias to show link to create or view pull request for current branch
pr = "!f() { git remote get-url origin | sed 's/git@github.com://g' | sed 's/.git//g' | awk '{print \"https://github.com/\"$1\"/pull/'$(git rev-parse --abbrev-ref HEAD)'\"}'; }; f"
pr = "!f() { exo-open $(git remote get-url origin | sed 's/git@github.com://g' | sed 's/.git//g' | awk '{print \"https://github.com/\"$1\"/pull/'$(git rev-parse --abbrev-ref HEAD)'\"}'); }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment