Skip to content

Instantly share code, notes, and snippets.

@MaximeD
Created January 27, 2018 09:14
Show Gist options
  • Save MaximeD/e3f6d2d3c111579afa54adba9dcf6805 to your computer and use it in GitHub Desktop.
Save MaximeD/e3f6d2d3c111579afa54adba9dcf6805 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Full repository name (group and project)
repo=$(echo $(git ls-remote --get-url) | sed 's/git@github.com:\(.\+\)\.git/\1/')
# Branch name
branch=$(git rev-parse --abbrev-ref HEAD)
# Display link to pull request
echo "Create pull request for pre-push_hook:"
echo -e "\thttps://github.com/$repo/compare/$branch?expand=1"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment