Skip to content

Instantly share code, notes, and snippets.

@Fleshgrinder
Created June 19, 2018 16:56
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 Fleshgrinder/1746e0e984c4268de5466baa60d57db5 to your computer and use it in GitHub Desktop.
Save Fleshgrinder/1746e0e984c4268de5466baa60d57db5 to your computer and use it in GitHub Desktop.
Show GitHub link for PR creation after pushing to remote. Store this in `.git/hooks/pre-push` and make it executable.
#!/bin/sh
cat << EOF
Create PR at: https://github.com/$(git remote get-url origin | grep -Eo '[^/:]+/[^/.]+')/compare/$(git rev-parse --abbrev-ref HEAD)?expand=1
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment