Skip to content

Instantly share code, notes, and snippets.

View hbshun's full-sized avatar
:octocat:
working hard.

邦邦 hbshun

:octocat:
working hard.
View GitHub Profile
@coin8086
coin8086 / using-proxy-for-git-or-github.md
Last active April 7, 2024 07:40
Use Proxy for Git/GitHub

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p
@twiceyuan
twiceyuan / LC_CTYPE.md
Last active August 2, 2019 18:29 — forked from jampajeen/LC_CTYPE.txt
[Linux 编码配置] Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory #Linux

file

vi /etc/environment

add these lines...

LANG=en_US.utf-8

LC_ALL=en_US.utf-8

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy