Skip to content
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

Add the local SSH key to GitHub #2110

Open
cubuspl42 opened this issue Apr 13, 2019 · 1 comment
Open

Add the local SSH key to GitHub #2110

cubuspl42 opened this issue Apr 13, 2019 · 1 comment
Labels

Comments

@cubuspl42
Copy link

It would be awesome if hub had an option to add a local SSH key to GitHub. Basically something like ssh-keyreg, but without the need to install yet another command line tool if we already have hub.

It would be even better if after hub clone ... -> "Permission denied (publickey)" error hub could ask "Would you like to add your local SSH public key to your GitHub account?".

Generating new ssh keys would be fine too!

I'm aware that there's a (closed) issue #611, but I'm struggling to understand the motivation behind closing it. The closing comment has a score of -10 and mentions that HTTPS is better, or something like that. But:

  1. When I run hub clone <reponame> it uses SSH by default
  2. As far as I know, ssh is still the simplest solution when you need a read/write access to the repo without retyping the password
  3. The only pain in the ass is that you need to generate a ssh key when you setup a new computer, which is exactly what hub could automate
  4. SSH is one of two primary protocols of git, and some users just might prefer it over HTTPS for any reason

I'm totally aware that it's an open source project (thank you for it!). Nobody says that it needs to be implemented right now, but I believe that leaving this feature request open would be a good opportunity for people to comment and leave their opinions.

@mislav
Copy link
Owner

mislav commented Apr 13, 2019

All your points are really excellent. In order:

but without the need to install yet another command line tool if we already have hub.

👍

It would be even better if after hub clone ... -> "Permission denied (publickey)" error hub could ask "Would you like to add your local SSH public key to your GitHub account?".

YES this is a really great idea 👏 I don't think there's need for a specialized command if hub would automatically manage the user experience like this.

Generating new ssh keys would be fine too!

Generating new SSH keys is such a sensitive process that I would always suggest to any user that it should be done as it's own step and that hub should not try to encapsulate that experience. Although, hub could help you get on the right track when doing it, e.g. by outputting example commands that you could run.

I'm aware that there's a (closed) issue #611, but I'm struggling to understand the motivation behind closing it.

That one is simple for me to answer. Lots of people have had great feature ideas for hub over the years, but there was mostly just me as a maintainer for. Therefore, I tend to be on the defensive against new features, especially if they involve defining new hub commands. For every idea that I evaluate, I ask myself:

  1. Would such a command get high usage?
  2. Does it significantly help with people's day-to-day workflows with GitHub?
  3. Would it have potential backwards- or forward-compatibility problems with git over time?
  4. And—most importantly—do I see myself (or someone else) maintaining this feature for years to come?

If the answer to any of these is "no" or "I'm not sure", I don't feel comfortable greenlighting someone to submit a PR.

https://twitter.com/slicknet/status/471834362950844416
https://twitter.com/peterbourgon/statuses/853268787398934528

1. When I run hub clone <reponame> it uses SSH by default

That's true, but I wanted to change that default for years now and never gotten around to actually doing it. We at GitHub generally recommend HTTPS.

But I see what you're saying— if SSH is our default, then we should have made the experience of setting up cloning from GitHub over SSH a better one.

4. SSH is one of two primary protocols of git, and some users just might prefer it over HTTPS for any reason

For sure! Many users still use SSH and we will continue to support it in hub. I think hub being more helpful around SSH authentication errors and helping you to set up and upload your SSH key would definitely be the way to go. 👍

@mislav mislav added the feature label Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants