cli/pkg/cmd
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
..
actions Mark actions command as non-runnable 2021-11-03 16:58:51 +01:00
alias Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
api Clarify magic type conversion of api params (#4434) 2021-11-18 14:14:50 +00:00
auth Add auth setup-git for setting up gh as a git credential helper (#4246) 2021-12-02 16:38:34 +00:00
browse Encode segments of gh browse resulting URL (#4663) 2021-11-18 13:10:55 +00:00
codespace Fix codespace code command under WSL (#4747) 2021-11-24 16:18:24 +00:00
completion Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
config linter complains again 2021-11-16 10:43:25 -08:00
extension go fmt 2021-12-02 16:12:24 +01:00
factory Avoid resolving executable() until requested at runtime 2021-09-24 14:42:41 +02:00
gist Repace shurcool/graphql with cli/shurcool-graphql 2021-11-17 12:57:43 -08:00
gpg-key Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
issue Improve issue view re: overfetching, PR support 2021-11-24 18:49:36 +01:00
pr pr diff: support very long lines 2021-12-01 17:03:11 +01:00
release Allow downloading the archive of the latest release 2021-11-30 15:52:51 +01:00
repo Merge pull request #4750 from cli/replace-shurcool 2021-11-18 09:10:06 -08:00
root Inherit API endpoint configuration from the Codespaces environment (#4723) 2021-11-22 12:40:01 +01:00
run Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
secret Add secret set --no-store to print the encrypted secret (#4423) 2021-12-02 16:05:10 +00:00
ssh-key Don't swallow duplicate key error (#4807) 2021-11-25 13:22:42 +01:00
version Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
workflow Escape workflow information when generating URLs 2021-11-18 12:17:59 -08:00