cli/pkg/cmd/auth/shared
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
..
git_credential.go Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
git_credential_test.go Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
login_flow.go Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
login_flow_test.go Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
oauth_scopes.go auth refresh: preserve existing scopes when requesting new ones 2021-10-14 19:52:59 +02:00
oauth_scopes_test.go Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
ssh_keys.go Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00