{"thread":{"id":"55981","subject":"About the usage of core.gitproxy.","startedAt":"2021-06-21T21:58:45Z","lastAt":"2021-06-21T23:34:15Z","messageCount":2,"participants":["Hongyi Zhao","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"428116","messageId":"CAGP6POJErqxTf1=u=N0Fg28Fz+8t3Y8o1peiGP1nqEuttKgN2w@mail.gmail.com","threadId":"55981","inReplyTo":null,"subject":"About the usage of core.gitproxy.","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2021-06-21T21:58:29Z","receivedAt":"2021-06-21T21:58:45Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"On Ubuntu 20.04, I noticed the following document for `core.gitProxy':\n\n$ man git-config |egrep -A13 -i '^[ ]*core.gitproxy'\n       core.gitProxy\n           A \"proxy command\" to execute (as command host port) instead\nof establishing direct connection to\n           the remote server when using the Git protocol for fetching.\nIf the variable value is in the\n           \"COMMAND for DOMAIN\" format, the command is applied only on\nhostnames ending with the specified\n           domain string. This variable may be set multiple times and\nis matched in the given order; the\n           first match wins.\n\n           Can be overridden by the GIT_PROXY_COMMAND environment\nvariable (which always applies\n           universally, without the special \"for\" handling).\n\n           The special string none can be used as the proxy command to\nspecify that no proxy be used for a\n           given domain pattern. This is useful for excluding servers\ninside a firewall from proxy use,\n           while defaulting to a common proxy for external domains.\n\nFor my case, I've a local socks5 proxy running on \"127.0.0.1:18888\",\nhow should I set the above option so that the following command can\npick up this proxy:\n\n$ git clone git@github.com:torvalds/linux.git\n\nRegards\n-- \nAssoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>\nTheory and Simulation of Materials\nHebei Vocational University of Technology and Engineering\nNO. 552 North Gangtie Road, Xingtai, China\n"},{"id":"428143","messageId":"YNEh06GSuoix+75h@camp.crustytoothpaste.net","threadId":"55981","inReplyTo":"CAGP6POJErqxTf1=u=N0Fg28Fz+8t3Y8o1peiGP1nqEuttKgN2w@mail.gmail.com","subject":"Re: About the usage of core.gitproxy.","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-06-21T23:33:39Z","receivedAt":"2021-06-21T23:34:15Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-06-21 at 21:58:29, Hongyi Zhao wrote:\n> On Ubuntu 20.04, I noticed the following document for `core.gitProxy':\n> \n> $ man git-config |egrep -A13 -i '^[ ]*core.gitproxy'\n>        core.gitProxy\n>            A \"proxy command\" to execute (as command host port) instead\n> of establishing direct connection to\n>            the remote server when using the Git protocol for fetching.\n> If the variable value is in the\n>            \"COMMAND for DOMAIN\" format, the command is applied only on\n> hostnames ending with the specified\n>            domain string. This variable may be set multiple times and\n> is matched in the given order; the\n>            first match wins.\n> \n>            Can be overridden by the GIT_PROXY_COMMAND environment\n> variable (which always applies\n>            universally, without the special \"for\" handling).\n> \n>            The special string none can be used as the proxy command to\n> specify that no proxy be used for a\n>            given domain pattern. This is useful for excluding servers\n> inside a firewall from proxy use,\n>            while defaulting to a common proxy for external domains.\n\nThis configuration option is for the plain, unencrypted Git protocol\nusually served on port 9418.  Almost nobody uses that these days,\nthough, since it is unencrypted.  This configuration option doesn't have\nany effect on HTTPS or SSH operations.\n\n> For my case, I've a local socks5 proxy running on \"127.0.0.1:18888\",\n> how should I set the above option so that the following command can\n> pick up this proxy:\n> \n> $ git clone git@github.com:torvalds/linux.git\n\nIn this case, you need SSH to tunnel through a SOCKS proxy.  According\nto [0], you can do this with the following data in your ~/.ssh/config:\n\n  Host github.com\n    ProxyCommand /usr/bin/nc -X 5 -x 127.0.0.1:7777 %h %p\n\nIf you want to do this as a one-off, you can also do this:\n\n  GIT_SSH_COMMAND='ssh -oProxyCommand=\"/usr/bin/nc -X 5 -x 127.0.0.1:7777 %h %p\"' \\\n    git clone git@github.com:torvalds/linux.git\n\nNote that that requires a POSIX shell; I don't think it will work under\nCMD or PowerShell.\n\n[0] https://superuser.com/questions/454210/how-can-i-use-ssh-with-a-socks-5-proxy\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"}]}