File tree 1 file changed +42
-0
lines changed 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,48 @@ This closes the issue and references the closing commit.
91
91
92
92
![ Closing Repo] ( http://i.imgur.com/URXFprQ.png )
93
93
94
+ ## Checking out pull requests
95
+
96
+ If you want to check out pull request locally, you can fetch it using that command:
97
+
98
+ ``` bash
99
+ $ git fetch origin ' +refs/pull/*/head:refs/pull/*'
100
+ ```
101
+
102
+ then, checkout pr (i.e. 42) using
103
+
104
+ ``` bash
105
+ $ git checkout refs/pull/42
106
+ ```
107
+
108
+ Alternatively, you can fetch them as remote branches:
109
+
110
+ ``` bash
111
+ $ git fetch origin ' +refs/pull/*/head:refs/remotes/origin/pr/*'
112
+ ```
113
+
114
+ and checkout as
115
+
116
+ ``` bash
117
+ $ git checkout origin/pr/42
118
+ ```
119
+
120
+ and even fetch them automatically, if you add corresponding lines in your .git/config:
121
+
122
+
123
+ ```
124
+ [remote "origin"]
125
+ fetch = +refs/heads/*:refs/remotes/origin/*
126
+ url = git@github.com:tiimgreen/github-cheat-sheet.git
127
+ ```
128
+
129
+ ```
130
+ [remote "origin"]
131
+ fetch = +refs/heads/*:refs/remotes/origin/*
132
+ url = git@github.com:tiimgreen/github-cheat-sheet.git
133
+ fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
134
+ ```
135
+
94
136
## Cross-link issues
95
137
96
138
If you want to link to another issue in the same repo, simple type hash ` # ` then the issue number, it will be auto-linked.
You can’t perform that action at this time.
0 commit comments