Skip to content

Commit 2acb308

Browse files
author
Rafal Chmiel
committed
Merge pull request tiimgreen#78 from GaborApatiNagy/checkoutpullglobally
Added how to set up git globally to to fetch pull requests
2 parents 88336fe + 0430782 commit 2acb308

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,22 @@ For Fork-based Pull Request contributions, it's useful to `checkout` a remote br
632632
$ git checkout pr/42 pr-42
633633
```
634634

635+
Or should you work on more repositories, you can globally configure fetching pull requests in the global git config instead.
636+
637+
```bash
638+
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
639+
```
640+
641+
This way, you can use the following short commands in all your repositories:
642+
643+
```bash
644+
git fetch origin
645+
```
646+
647+
```bash
648+
git checkout pr/42
649+
```
650+
635651
[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally)
636652

637653
### Empty Commits :trollface:

0 commit comments

Comments
 (0)