@@ -77,49 +77,24 @@ To read a gist and print it to STDOUT
7777
7878See ` gist --help ` for more detail.
7979
80- ## Authentication
80+ ## Login
8181
82- To associate and manage uploaded gists with your GitHub account, ` gist ` needs an
83- authentication token, with at least the "gist" permission. The token can be
84- obtained using ` gist --login ` . Alternately, you may generate a personal access
85- token through https://github.com/settings/tokens and save it in ` ~/.netrc ` .
82+ If you want to associate your gists with your GitHub account, you need to login
83+ with gist. It doesn't store your username and password, it just uses them to get
84+ an OAuth2 token (with the "gist" permission).
8685
87- ### Authenticating with ` gist --login `
88-
89- Gist can login to your GitHub account. It doesn't store your Github username or
90- password, it just uses them to get an OAuth2 token (with the "gist" permission).
91-
92- $ gist --login
86+ gist --login
9387 Obtaining OAuth2 access_token from github.
9488 GitHub username: ConradIrwin
9589 GitHub password:
9690 2-factor auth code:
9791 Success! https://github.com/settings/tokens
9892
99- This token is stored in ` ~/.gist ` and used for all future gisting. The generated
100- token will be listed in https://github.com/settings/tokens , and can also be
101- revoked from there.
102-
103- ### Credentials in ` ~/.netrc `
104-
105- Gist can make use of a personal token stored in ` ~/.netrc ` . Github credentials
106- stored in this file are matched by the hostname, and can be shared among
107- different tools, like ` git ` , and ` curl ` .
108-
109- The ` ~/.netrc ` file should be unreadable by anyone except the owner. To store
110- your gist token in ` ~/.netrc ` , use the format:
93+ This token is stored in ` ~/.gist ` and used for all future gisting. If you need to
94+ you can revoke it from https://github.com/settings/tokens , or just delete the
95+ file.
11196
112- machine github.com
113- password PERSONAL_ACCESS_TOKEN
114-
115- You may also maintain a separate token exclusively for gisting by associating
116- the token with the hostname ` gist.github.com ` , and setting the environment
117- variable ` GITHUB_URL=https://gist.github.com ` .
118-
119- ### Uploading anonymous gists
120-
121- Independently of the authentication mechanism used, you can always upload gists
122- anonymously by using the ` -a ` option.
97+ After you've done this, you can still upload gists anonymously with ` -a ` .
12398
12499 gist -a a.rb
125100
@@ -128,19 +103,13 @@ anonymously by using the `-a` option.
128103If you'd like ` gist ` to use your locally installed [ GitHub Enterprise] ( https://enterprise.github.com/ ) ,
129104you need to export the ` GITHUB_URL ` environment variable (usually done in your ` ~/.bashrc ` ).
130105
131- export GITHUB_URL=https ://github.internal.example.com/
106+ export GITHUB_URL=http ://github.internal.example.com/
132107
133108Once you've done this and restarted your terminal (or run ` source ~/.bashrc ` ), gist will
134109automatically use github enterprise instead of the public github.com
135110
136- When using ` gist --login ` your token for GitHub Enterprise will be stored in
137- ` .gist.<protocol>.<server.name>[.<port>] ` (e.g.
138- ` ~.gist.https.github.internal.example.com ` for the GITHUB_URL example above)
139- instead of ` ~/.gist ` . The token can also be stored in ` ~/.netrc ` with an
140- appropriate entry for the host. For instance, for the example above,
141-
142- machine github.internal.example.com
143- password GITHUB_ENTERPRISE_TOKEN
111+ Your token for GitHub Enterprise will be stored in ` .gist.<protocol>.<server.name>[.<port>] ` (e.g.
112+ ` ~.gist.http.github.internal.example.com ` for the GITHUB_URL example above) instead of ` ~/.gist ` .
144113
145114If you have multiple servers or use Enterprise and public GitHub often, you can work around this by creating scripts
146115that set the env var and then run ` gist ` . Keep in mind that to use the public GitHub you must unset the env var. Just
0 commit comments