cli/pkg/cmd/auth
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
..
gitcredential Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
login Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
logout Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
refresh Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
setupgit Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
shared Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
status Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
auth.go Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00