Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zu1k committed Feb 3, 2024
1 parent 6f78936 commit 7afc09b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions content/posts/coding/set-proxy-for-git.md
Expand Up @@ -53,3 +53,28 @@ windows如果安装了`mingw`也可以使用`connect`命令来替代`nc`命令
Host github.com
ProxyCommand connect -S 127.0.0.1:1080 %h %p
```

## 其他方法

### 将 ssh 协议转为 https 协议

修改 `~/.gitconfig`,将 ssh 协议转为 https 协议:

```
[url "git@github.com:"]
insteadOf = https://github.com/
```

### 使用 443 端口绕过防火墙

GitHub 在 ssh.github.com:443 提供了 SSH 协议,主要用于绕过企业防火墙

修改 `~/.ssh/config`

```
Host github.com
Hostname ssh.github.com
Port 443
User git
```

0 comments on commit 7afc09b

Please sign in to comment.