cli/pkg/cmd/auth
Mislav Marohnić 98f1f5ec0d Use absolute path when configuring gh as git credential
This keeps git operations working even when PATH is modified, e.g. `brew
update` will work even though Homebrew runs the command explicitly
without `/usr/local/bin` in PATH.

Additionally, this inserts a blank value for `credential.*.helper` to
instruct git to ignore previously configured credential helpers, i.e.
those that might have been set up in system configuration files. We do
this because otherwise, git will store the credential obtained from gh
in every other credential helper in the chain, which we want to avoid.

Before:

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

After:

    git config --global credential.https://github.com.helper ''
    git config --global --add credential.https://github.com.helper '!/path/to/gh auth git-credential'
2021-03-03 16:20:21 +01:00
..
gitcredential Fix auth git-credential when the token comes from environment 2021-02-19 15:37:11 +01:00
login Use absolute path when configuring gh as git credential 2021-03-03 16:20:21 +01:00
logout More descriptive error when aborting auth due to environment variables 2021-01-20 18:27:35 +01:00
refresh Use absolute path when configuring gh as git credential 2021-03-03 16:20:21 +01:00
shared Use absolute path when configuring gh as git credential 2021-03-03 16:20:21 +01:00
status Add SSH key generation & uploading to gh auth login flow 2021-02-01 23:34:00 +01:00
auth.go If git credential helper is non-defined, set gh as credential helper 2020-11-23 20:20:05 +01:00