...
Code Block | ||
---|---|---|
| ||
$ git clone github.com:openjdk/jdk $ git clone github:openjdk/jdk $ git clone gh:openjdk/jdk |
My computer is behind a HTTP(S) proxy, can I still clone using SSH?
Yes, by adding a ProxyCommand
directive in your SSH configuration ~/.ssh/config
. The value for ProxyCommand
is operating system dependent, since different programs are available on different operating systems. Please follow the instructions specific for your operating system below:
GNU/Linux
Add the following lines to ~/.ssh/config
:
Code Block | ||
---|---|---|
| ||
Host github.com github gh
User git
Hostname github.com
ProxyCommand nc --proxy PROXY-HOSTNAME:PROXY-PORT %h %p |
Substitute PROXY-HOSTNAME
with the hostname of the HTTP(S) proxy server, and PROXY-PORT
with the port of the HTTP(S) proxy server.
macOS
Add the following lines to ~/.ssh/config
:
Code Block | ||
---|---|---|
| ||
Host github.com github gh
User git
Hostname github.com
ProxyCommand /usr/bin/nc -X connect -x PROXY-HOSTNAME:PROXY-PORT %h %p |
Substitute PROXY-HOSTNAME
with the hostname of the HTTP(S) proxy server, and PROXY-PORT
with the port of the HTTP(S) proxy server. Note that the full path to nc
must be used since Homebrew might install the GNU version of nc
(which does not support the -X
flag).
Windows
Shell
Bash
Can I see the currently checked out local branch in my prompt?
...