From 04307829a644016ea7df246e3eeaaace403438ab Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Sat, 12 Jul 2014 00:42:12 +0100 Subject: [PATCH] Added how to set up git globally to to fetch pull requests --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 58b6326..251a103 100644 --- a/README.md +++ b/README.md @@ -632,6 +632,22 @@ For Fork-based Pull Request contributions, it's useful to `checkout` a remote br $ git checkout pr/42 pr-42 ``` +Or should you work on more repositories, you can globally configure fetching pull requests in the global git config instead. + +```bash +git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" +``` + +This way, you can use the following short commands in all your repositories: + +```bash +git fetch origin +``` + +```bash +git checkout pr/42 +``` + [*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### Empty Commits :trollface: