You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build/gist.1
+48-19Lines changed: 48 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
.\" generated with Ronn/v0.7.3
2
2
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
.
4
-
.TH "GIST" "1" "May 2018" "" "Gist manual"
4
+
.TH "GIST" "1" "August 2020" "" "Gist manual"
5
5
.
6
6
.SH "NAME"
7
7
\fBgist\fR\- upload code to https://gist\.github\.com
@@ -29,6 +29,12 @@ For OS X, gist lives in Homebrew
29
29
.IP
30
30
brew install gist
31
31
.
32
+
.IP"\(bu"4
33
+
For FreeBSD, gist lives in ports
34
+
.
35
+
.IP
36
+
pkg install gist
37
+
.
32
38
.IP""0
33
39
.
34
40
.SH "Command"
@@ -121,14 +127,45 @@ See \fBgist \-\-help\fR for more detail\.
121
127
.IP""0
122
128
.
123
129
.SH "Login"
124
-
If you want to associate your gists with your GitHub account, you need to login with gist\. It doesn\'t store your username and password, it just uses them to get an OAuth2 token (with the "gist" permission)\.
130
+
Before you use \fBgist\fR for the first time you will need to log in\. There are two supported login flows:
131
+
.
132
+
.IP"1."4
133
+
The Github device\-code Oauth flow\. This is the default for authenticating to github\.com, and can be enabled for Github Enterprise by creating an Oauth app, and exporting the environment variable \fBGIST_CLIENT_ID\fR with the client id of the Oauth app\.
134
+
.
135
+
.IP"2."4
136
+
The (deprecated) username and password token exchange flow\. This is the default for GitHub Enterprise, and can be used to log into github\.com by exporting the environment variable \fBGIST_USE_USERNAME_AND_PASSWORD\fR\.
137
+
.
138
+
.IP""0
139
+
.
140
+
.SS "The device\-code flow"
141
+
This flow allows you to obtain a token by logging into GitHub in the browser and typing a verification code\. This is the preferred mechanism\.
142
+
.
143
+
.IP""4
144
+
.
145
+
.nf
146
+
147
+
gist \-\-login
148
+
Requesting login parameters\.\.\.
149
+
Please sign in at https://github\.com/login/device
The returned access_token is stored in \fB~/\.gist\fR and used for all future gisting\. If you need to you can revoke access from https://github\.com/settings/connections/applications/4f7ec0d4eab38e74384e\.
159
+
.
160
+
.SS "The username\-password flow"
161
+
This flow asks for your GitHub username and password (and 2FA code), and exchanges them for a token with the "gist" permission (your username and password are not stored)\. This mechanism is deprecated by GitHub, but may still work with GitHub Enterprise\.
This token is stored in \fB~/\.gist\fR and used for all future gisting\. If you need to you can revoke it from https://github\.com/settings/tokens, or just delete the file\.
143
180
.
144
-
.IP"\(bu"4
145
-
After you\'ve done this, you can still upload gists anonymously with \fB\-a\fR\.
146
-
.
147
-
.IP
148
-
gist \-a a\.rb
149
-
.
150
-
.IP""0
151
-
.
152
181
.P
153
-
If you have a complicated authorization requirement you can manually create a token file by pasting a Github token with only the \fBgist\fRpermission into a file called \fB~/\.gist\fR\. You can create one from https://github\.com/settings/tokens
182
+
If you have a complicated authorization requirement you can manually create a token file by pasting a GitHub token with \fBgist\fR scope (and maybe the \fBuser:email\fRfor GitHub Enterprise) into a file called \fB~/\.gist\fR\. You can create one from https://github\.com/settings/tokens
154
183
.
155
184
.P
156
-
This file should contain only the token (~40 hex characters), and to make it easier to edit, can optionally have a final newline (\en or \er\en)\.
185
+
This file should contain only the token (~40 hex characters), and to make it easier to edit, can optionally have a final newline (\fB\en\fR or \fB\er\en\fR)\.
157
186
.
158
187
.P
159
188
For example, one way to create this file would be to run:
@@ -162,12 +191,15 @@ For example, one way to create this file would be to run:
162
191
.
163
192
.nf
164
193
165
-
echo MY_SECRET_TOKEN > ~/\.gist
194
+
(umask 0077 && echo MY_SECRET_TOKEN > ~/\.gist)
166
195
.
167
196
.fi
168
197
.
169
198
.IP""0
170
199
.
200
+
.P
201
+
The \fBumask\fR ensures that the file is only accessible from your user account\.
202
+
.
171
203
.SS "GitHub Enterprise"
172
204
If you\'d like \fBgist\fR to use your locally installed GitHub Enterprise \fIhttps://enterprise\.github\.com/\fR, you need to export the \fBGITHUB_URL\fR environment variable (usually done in your \fB~/\.bashrc\fR)\.
Once you\'ve done this and restarted your terminal (or run \fBsource~/\.bashrc\fR), gist will automatically use github enterprise instead of the public github\.com
217
+
Once you\'ve done this and restarted your terminal (or run \fBsource~/\.bashrc\fR), gist will automatically use GitHub Enterprise instead of the public github\.com
186
218
.
187
219
.P
188
220
Your token for GitHub Enterprise will be stored in \fB\.gist\.<protocol>\.<server\.name>[\.<port>]\fR (e\.g\.\fB~/\.gist\.http\.github\.internal\.example\.com\fR for the GITHUB_URL example above) instead of \fB~/\.gist\fR\.
@@ -218,9 +250,6 @@ If you need more advanced features you can also pass:
218
250
\fB:update\fR to update an existing gist (can be a URL or an id)\.
219
251
.
220
252
.IP"\(bu"4
221
-
\fB:anonymous\fR to submit an anonymous gist (default is false)\.
222
-
.
223
-
.IP"\(bu"4
224
253
\fB:copy\fR to copy the resulting URL to the clipboard (default is false)\.
225
254
.
226
255
.IP"\(bu"4
@@ -229,7 +258,7 @@ If you need more advanced features you can also pass:
229
258
.IP""0
230
259
.
231
260
.P
232
-
NOTE: The access_token must have the "gist" scope\.
261
+
NOTE: The access_token must have the \fBgist\fR scope and may also require the \fBuser:email\fR scope\.
233
262
.
234
263
.IP"\(bu"4
235
264
If you want to upload multiple files in the same gist, you can:
0 commit comments