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