You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was lucky to find the below comment. But after installing a fresh git on my new mac, I really struggled to get authentication working. I first tried the interactive gh auth login, but that didn't work after pasting my token. Then I tried the explicit gh auth login --with-token, pasting the token. Also, doesn't work as the token has to be piped from a file. But then still no luck. Finally ran the below commands.
This is all very confusing and undocumented. I know a lot of people are struggling with github authentication. Feel that this could be more user friendly/better documented.
@atsalolikhin-spokeo It looks like you are successfully logged in to gh with the token from your GITHUB_TOKEN environment variable, but that doesn't yet guarantee that git operations (such as git clone) are authenticated using the same mechanism.
This sets up gh as the credential helper for git operations. In fact, this is what GitHub CLI would do during normal gh auth login flow, which for you was skipped because you had already set up GITHUB_TOKEN via your environment variables. Since your environment contains signs of manual setup, we assume that you want to go the full manual route and not have gh intervene.
We plan to improve authentication for git commands spawned from within GitHub CLI: #2944
but that still won't cover regular git operations for people who have skipped gh auth login.
If you are using a credential helper that isn't gh, when you go through gh auth login, after being prompted for protocol choice, you will be prompted "Authenticate Git with your GitHub credentials?", which will give the obtained token to your credential helper.
On the other hand, if you run gh auth setup-git then gh will configure itself as a git credential helper and then any token you obtain via auth login (or via GH_TOKEN) will also be used.
Do you think it would help to include some of this information directly in the auth login --help? It seems reasonable that people would want to understand this from the entrypoint of auth login. Thanks.
I was lucky to find the below comment. But after installing a fresh git on my new mac, I really struggled to get authentication working. I first tried the interactive gh auth login, but that didn't work after pasting my token. Then I tried the explicit
gh auth login --with-token, pasting the token. Also, doesn't work as the token has to be piped from a file. But then still no luck. Finally ran the below commands.This is all very confusing and undocumented. I know a lot of people are struggling with github authentication. Feel that this could be more user friendly/better documented.
Originally posted by @mislav in #3369
The text was updated successfully, but these errors were encountered: