Advertisement
Guest User

Untitled

a guest
May 5th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Locate the section for your github remote in the `.git/config` file. It looks like this:
  2.  
  3. ```
  4. [remote "origin"]
  5. fetch = +refs/heads/*:refs/remotes/origin/*
  6. url = git@github.com:joyent/node.git
  7. ```
  8.  
  9. Now add the line `fetch = +refs/pull/*/head:refs/remotes/origin/pr/*` to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
  10.  
  11. ```
  12. [remote "origin"]
  13. fetch = +refs/heads/*:refs/remotes/origin/*
  14. url = git@github.com:joyent/node.git
  15. fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
  16. ```
  17.  
  18. Now fetch all the pull requests:
  19.  
  20. ```
  21. $ git fetch origin
  22. From github.com:joyent/node
  23. * [new ref] refs/pull/1000/head -> origin/pr/1000
  24. * [new ref] refs/pull/1002/head -> origin/pr/1002
  25. * [new ref] refs/pull/1004/head -> origin/pr/1004
  26. * [new ref] refs/pull/1009/head -> origin/pr/1009
  27. ...
  28. ```
  29.  
  30. To check out a particular pull request:
  31.  
  32. ```
  33. $ git checkout pr/999
  34. Branch pr/999 set up to track remote branch pr/999 from origin.
  35. Switched to a new branch 'pr/999'
  36. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement