mislav / hub

A command-line tool that makes git easier to use with GitHub.

Home Page:https://hub.github.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hub asking for username and password when used with ssh protocol

metapraveen opened this issue · comments

Command attempted:
hub clone dot-files

What happened:
promts for username

More info:
git config --global hub.protocol
ssh

hub --version
git version 2.37.0 (Apple Git-136)
hub version refs/heads/master

OS
macOS 12.6 (21G115)

Giving full URL works fine for e.g. hub clone git@github.com:metapraveen/dot-files.git clones the repo via ssh auth

hub is failing for me like this, too, anytime I try something that requires authentication. git clone and git push work, but not the hub versions of these commands.

(master) % hub create
github.com username: chaimleib
github.com password for chaimleib (never stored):
Error creating repository: Not Found (HTTP 404)
Not Found
% hub --version
git version 2.38.2
hub version 2.14.2

I've tried both of these:

% git config --global hub.protocol https
% git config --global hub.protocol ssh

I have URL replacement on to force ssh instead of https on github, but both above configs also fail, even if I turn replacement off:

[url "git@github.com:"]
	insteadOf = https://github.com/

macOS 10.15.7

Yeah, hub has not been usable for anything for the last six months. Only auth errors and no prompting to authenticate using browser or similar.

OK It's not just me. Same issue.

Edit: You need to use PAT as password (#2655 (comment))

That is a workaround, not a fix for the broken 2FA handling. A better workaround is to just ditch Hub for the official GitHub CLI, as Hub is essentially deprecated: https://mislav.net/2020/01/github-cli. All of Mislav's efforts go into that these days and I have been able to transition from all current Hub commands to gh very easily (i.e. gh pr checkout <issue>, gh browse, ...)