Last active
August 7, 2018 18:55
-
-
Save spencerdcarlson/417093547bca007a0e6cda210d8b18c0 to your computer and use it in GitHub Desktop.
Shortcut to open the GitHub link to open a pull request (Mac)
This file contains hidden or 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 ruby | |
url = `git config --get remote.origin.url`.chomp | |
if url.include? '@' | |
url = "https://#{url.sub(':','/').split('@')[1]}" | |
end | |
url.slice!('.git') | |
url += "/compare/#{ARGV[0]}...#{ARGV[1]}" | |
`open #{url}` | |
# HOW TO USE | |
# $ chmod +x git-pr # make executable | |
# $ mv git-pr /usr/local/bin # add to path | |
# $ git-pr master develop # open link to create a pull request from develop into master | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment