https://github.com/ozh/git-pr
git pr : easily work with PR from Github
https://github.com/ozh/git-pr
git git-addons php pull-request pull-requests
Last synced: 6 months ago
JSON representation
git pr : easily work with PR from Github
- Host: GitHub
- URL: https://github.com/ozh/git-pr
- Owner: ozh
- Created: 2015-04-11T14:40:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T15:58:04.000Z (over 5 years ago)
- Last Synced: 2025-03-27T00:54:57.592Z (7 months ago)
- Topics: git, git-addons, php, pull-request, pull-requests
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git pr
Simple script for `git`, to locally pull a PR from Github, with an option to _not_ commit changes
## Install as a git alias:
Add this to your git config (eg `~/.gitconfig`)
```ini
[alias]
pr = "!php /full/path/to/ozh_git_pr.php"
```## Usage
Assuming you want to locally test PR #1337, just do:
```sh
git pr 1337
# or
git pr -n 1337
```In detail, this:
* creates a new branch named `pr-1337` and switch to it
* pulls whatever repo/branch has been submitted as the PR on Github
* with the `-n` option, does not commit changes, so you still see what files are modified and what's changed in themThis will be equivalent to :
```sh
git checkout -b pr-1337
git pull [--no-commit] https://github.com/SOMEDUDE/SOMEFORK.git SOMEBRANCH
```#### Why a `-n` switch ? Why would I want to *not* commit changes ?
With a gigantic pull request that changes a lot of files, it can be easier to review changes, since modified files are marked (if using a tool with icon overlays, like TortoiseGit)

From now on you can review, of course modify, and then commit changes, or simply `git merge --abort` if proposed changes are not suitable.
## License
Do whatever the hell you want to do with it