-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Dedicated command for authentication & configuration #225
Comments
This is unfortunate. What I need to do is save your username so you don't have to keep re-entering it. I don't think we need a specific command to configure your account. |
It's not an outlandish idea. Git has Mislav Marohnić [email protected] wrote:
|
DO IT ALREADY dammit |
You can drop something like this in
|
Thanks |
sheesh, can we have a little more love in our comments please? Anyway, I think explicit user config is a good idea. I have two github accounts because I did lots of tutorials teaching how git and github works. Now I have a tutorial github account + a kewl code github account. I'd like to be able to pick which github account Hub is working with:
And I'd like to be able to change it on the fly:
For now I'm just deleting the ~/.config/hub file over and over, but that's hackish. Maybe it could be pulling up which user is active from |
Is there anything approaching a spec for this feature? I may be willing to implement browser-based authentication (#889). Ideally I'd do it in a way that didn't require big rework when this |
I think we want the command to be called By default you will be authenticating with When implementing browser-based authentication, how do you plan to deal with the following problems:
|
Responded to @mislav's questions about authorization at #889 (comment) |
I’m also interested in this. I don’t want to configure What I want is to configure In addition, I have a script other people use that I’m using |
@mislav just ran into the problem mentioned back in #899. deleting As a short term fix, before something like |
It would be great if |
@greg-1-anderson For sure; hub won't change the way it handles GITHUB_TOKEN. It's still the preferred way for scripts. But for interactive use, it will be easier to set up a |
Other tools use |
@travi That post was from 2008. I'm not sure how many tools used right now honor this information in gitconfig. I discourage putting tokens in gitconfig in general since they could be accidentally leaked if you decide to version your dotiles and put them online. |
yeah, i don't actually use any of those tools, but do have that value set in my |
I visit you from the year 2018! In order to make some progress on this very old issue, I would be happy to submit a PR for Here's what I propose it would do:
It's basically the same flow that happens if I run, say, I am trying to get my team to use |
@samtstern Contributions very welcome! The Example: $ hub auth login # logs you in github.com
$ hub auth login http://git.my.org This command should also exit with a success status if current credentials exist and are valid, or warn and re-do the authentication process if the current credentials are invalid. |
@samtstern @mislav one thing that could be useful, is on first successful signin to github enterprise, write to github.com:
- user: brntbeer
oauth_token: xxxxxxxxxxxsssssssxxxxcdfdrttrertyhjk
protocol: https
github_enterprise:
- host: octodemo.com
user: brntbeer
oauth_token: 111234567rewwerjhgfdetcetc
protocol: https the reason why you may want more than one Edit: of course, do the easiest thing first, which is exclude GHE from this setting 😉 |
@brntbeer More than one Enterprise host is already supported in the config file in this format: octodemo.com:
- user: brntbeer
oauth_token: TOKEN1
protocol: https
git.myorg.com:
- user: beerbrent
oauth_token: TOKEN2
protocol: http I suppose what the new |
😞 dohh, you're right @mislav ❤️ |
There's a lot of scattered information about how to properly configure hub to be used on GitHub actions. This attempts to condense this to a simplified bit of information captured in the README. See: - mislav#1644 - mislav#225
All I really use hub for is pulling down my own repos. As a result, I've never been prompted for my username/password to connect to the API, so I'm always prompted for my username. I'd appreciate some way to just trigger the configuration by itself.
The text was updated successfully, but these errors were encountered: