Skip to content

Instantly share code, notes, and snippets.

@mathiasverraes
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathiasverraes/ce93e6aa7dd7db75d772 to your computer and use it in GitHub Desktop.
Save mathiasverraes/ce93e6aa7dd7db75d772 to your computer and use it in GitHub Desktop.
Add the requester's repo as a remote to yours - github

GitHub provides a special pulls remote "namespace" on the upstream repo, so you can add it as a fetch pattern to your .git/config like so:

    [remote "upstream"]
      url = https://github.com/neovim/neovim.git
      fetch = +refs/heads/*:refs/remotes/upstream/*
      fetch = +refs/pull/*/head:refs/pull/upstream/*

Then when you git fetch --all, you will have ALL pull requests available in your local repo in the local pull/ namespace. To check out PR #42:

    git checkout -b foo refs/pull/upstream/42

from https://news.ycombinator.com/item?id=9051220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment