背景・目的
なぜだか研究室のWiFi経由でSSHが通らないので、 GithubがBitbucketに繋がらない><。 有線LAN経由なら通るので、ネットワークの問題だと思うのですが、 よくわからないのでとりあえずHTTPS経由で頑張ることにしました。
うちの学校ではHTTPSで外部に出るにはプロキシの設定が必要です。 そういうわけで、Gitでプロキシを使う方法を調べて見ました。
方法
.ssh/config に以下の設定をしました。
Host github.com
    User git
    Port 22 # or 443
    Hostname github.com # or ssh.github.com
    IdentityFile /path/to/ssh.key
    TCPKeepAlive yes
    IdentitiesOnly yes
    ProxyCommand nc -X connect -x proxy.example.com:8080 %h %p