-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(3796): add cmd for setting up gh-cli as git cred helper #4246
Conversation
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
ed3d19f
to
d35b943
Compare
Adds a new command `gh auth setup-git [<hostname>]` that sets up git to use the GH 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 '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 and return a SilentError. Closes cli#3796
d35b943
to
2c41882
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed some tweaks/fixes/simplifications, and this is good to go! Thank you 🚀
are you suppose to run this after |
However, if someone had skipped that, then running |
Adds a new command
gh auth setup-git [<hostname>]
that sets up git touse the GH CLI as a credential helper.
The gist is that it runs these two git commands for each hostname the
user is authenticated with.
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 and return a SilentError.
Closes #3796