https://github.com/josephp27/pr
Open your pull request from the command line
https://github.com/josephp27/pr
Last synced: 5 months ago
JSON representation
Open your pull request from the command line
- Host: GitHub
- URL: https://github.com/josephp27/pr
- Owner: josephp27
- License: apache-2.0
- Created: 2020-10-07T16:12:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-07T16:14:24.000Z (over 5 years ago)
- Last Synced: 2025-05-23T07:16:54.948Z (about 1 year ago)
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PR
Open your pull request from the command line.
Add below to your bash profile, then type `pr` from your command line and watch your browser open to the PR
```bash
# get current git branch
branch() {
cat .git/HEAD | sed -ne 's/ref: refs\/heads\///p'
}
# open git pull request page for current repo and branch
pr() {
url=$(git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#https://#' -e 's@com:@com/@' -e 's%\.git$%%' | sed 's/\(.*\):/\1\//')
open "${url}"/pull/new/$(branch)
}
```