Skip to content

Why are credentials requested on gh repo clone when I am already authenticated with a PAT? #4333

Answered by mislav
mimkorn asked this question in Q&A
Discussion options

You must be logged in to vote

I'm sorry that this is confusing!

When your authenticate with GitHub CLI (e.g. via gh auth login), you've authenticated against the GitHub API, but that doesn't 100% ensure that all your git traffic is authenticated. GitHub API and git traffic to GitHub can use separate methods of authentication, and this isn't always clear to users. We aim to improve that in #2944

What you can do to remedy this:

  • When doing gh auth login, choose "Yes" for Authenticate git with your GitHub credentials?; or

  • Run this locally to configure git authentication:

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

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@kdere
Comment options

@samcoe
Comment options

@kdere
Comment options

@samcoe
Comment options

Answer selected by mimkorn
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants