The syntax thus can be overridden on a per-remote basis see remote.proxy See gitcredentials(7) for more information. String with a user name but no password, in which case git will attempt to acquire one in the same way itĭoes for other credentials. In addition to the syntax understood by curl, it is possible to specify a proxy Override the HTTP proxy, normally configured using the http_proxy, https_proxy, and all_proxy environment Git respects http_proxy and https_proxy envrionment variables, so you can simply execute the following command in a shell: export http_proxy=socks5://localhost:1080 https_proxy=socks5://localhost:1080Īfter that, your git command under the same shell will use the proxy for HTTP/HTTPS connections.īTW, Git also has a http.proxy configuration to override those two envrionment variables: http.proxy When you do git clone or git clone, you're using the HTTP/HTTPS protocol. Learm more about them if you're interested. The above SSH configuration involves Linux command nc and ssh config Prox圜ommand. This uses a proxy only for GitHub, so that when you git clone the proxy works. You may want to use a proxy for a specific host, say GitHub. If you want to use a HTTP proxy at localhost:1080, do it like: Prox圜ommand nc -X connect -x localhost:1080 %h %p This is to make all SSH connections, including those by Git, via the proxy at localhost:1080. Add the following to your SSH config file, say ~/.ssh/config: Prox圜ommand nc -x localhost:1080 %h %p You need to configurate your SSH client to use a proxy. When you do git clone or git clone you're using the SSH protocol. I'll talk about how to set up a SOCKS5 proxy later. In the following, I assume a SOCKS5 proxy set up on localhost:1080. And there're two common protocols: SSH and HTTP/HTTPS. Generally, the Git proxy configuration depends on the Git Server Protocol you use.
0 Comments
Leave a Reply. |