Closed mk0x9 closed 5 years ago
Is it possible to expand it to
git@github.com:user/repo.git
?
The SSH protocol for clone operations (i.e. the git@github.com:
URL format) will automatically be used if:
user/repo
is a private repository; oruser/repo
.Since neither of these is true for you and the github/hub
repo, the git://
protocol will be used for cloning. This should work. If it doesn't work, this is still not a bug with hub, but with something in your git setup or your network preventing clones via git:
protocol. Make sure that command git clone git://github.com/github/hub.git
works for you locally (this command skips hub entirely).
When debugging, avoid using GIT_TRACE for now as hub has some bugs with it that were fixed in master branch but not yet released: https://github.com/github/hub/commit/0be001f76dbdbc3a2382c2f9b3928b7740953bdf. You can use HUB_VERBOSE
instead.
Alternatively, you can skip both the SSH and git:
protocol and have hub generate HTTPS URLs for you:
git config --global hub.protocol https
You will have to set up git credential caching.
The SSH protocol for clone operations (i.e. the
git@github.com
: URL format) will automatically be used if:
user/repo
is a private repository; or- you have write access to
user/repo
.
Why not use for repositories with read-only access? I don't get it. Still works with ssh protocol, and user could been granted later with write permissions.
Would it be possible to add setting for overriding hub.protocol
with ssh procotol? Managing https credentials with git just only for github would be a little bit PITA, especially on linux & windows machines.
I really would prefer an option to force ssh protocol all the time. :/
There something probably with the network, as the git is from the Xcode, and .gitconfig contains nothing special, just name/email and reference to global gitignore.
$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 HUB_VERBOSE=1 command git clone git://github.com/github/hub.git
18:36:45.639567 exec-cmd.c:139 trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/bin/git
18:36:45.640094 exec-cmd.c:236 trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/bin
18:36:45.640171 git.c:418 trace: built-in: git clone git://github.com/github/hub.git
Cloning into 'hub'...
fatal: unable to connect to github.com:
github.com[0: 140.82.118.3]: errno=Operation timed out
I don't know, is it shitty ISP, corporate network or retrograde mercury.
I can try to debug it, but currently I have no ideas how to tackle this issue.
@mislav fixed it in gitconfig :)
[url "git@github.com:"]
insteadOf = git://github.com/
Still, the additional possible value to hub.protocol
would be nice to have.
@mk0x9 I'll consider adding an "always-ssh" config option when I'm reworking this whole part of the configuration next.
Great, thanks!
When using git clone with github's
user/repo
format it expands togit://github.com/user/repo.git
and git hangs indefinitely:Is it possible to expand it to
git@github.com:user/repo.git
?