cli/pkg
Des Preston 94a640bd2a
Add auth setup-git for setting up gh as a git credential helper (#4246)
Adds a new command `gh auth setup-git [<hostname>]` that sets up git to
use the GitHub CLI as a credential helper.

The gist is that it runs these two git commands for each hostname the
user is authenticated with.

```
git config --global --replace-all 'credential.https://github.com.helper' ''
git config --global --add 'credential.https://github.com.helper' '!gh auth git-credential'
```

If a hostname flag is given, it'll setup GH CLI as a credential helper
for only that hostname.

If the user is not authenticated with any git hostnames, or the user is
not authenticated with the hostname given as a flag, it'll print an
error.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-02 16:38:34 +00:00
..
cmd Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
cmdutil Fix stack overflow in AddJSONFlags (#4614) 2021-10-27 14:56:59 +02:00
export Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
extensions binary extension create 2021-11-23 16:53:45 -06:00
findsh go fmt 2021-12-02 16:12:24 +01:00
githubsearch Convert bool to string early for pr list draft flag 2021-09-20 11:29:37 -07:00
githubtemplate Use T.TempDir for temporary dirs in tests (#3580) 2021-05-07 12:21:26 +02:00
httpmock Adding gh release download for .zip and .tar.gz 2021-11-30 15:52:51 +01:00
iostreams go fmt 2021-12-02 16:12:24 +01:00
jsoncolor Fix "null" display in colored JSON output 2021-05-12 16:56:52 +02:00
liveshare Oops, left it as second from debugging 2021-10-28 16:33:13 -07:00
markdown Enable emoji in markdown 2021-04-12 09:50:51 -07:00
prompt make prompt.Confirm stubbable 2021-06-08 15:49:37 -05:00
set Have StringSet preserve original order of values 2021-04-07 19:55:09 +02:00
surveyext Fix test flaky due to race in showing/hiding cursor 2021-06-14 10:58:53 +02:00
text Add helper template functions for rendering tables (#3519) 2021-08-23 21:00:25 +02:00