GithubのSmart HTTP Supportで楽々プロキシ越えが可能に!!

プロキシに阻まれてgithubを使えなかった方、ssh経由でプチHack的にがんばっていた方に朗報です。


なんとgithubがhttp/https経由のpushにも対応してくれました!!
超Great!!!

Git's HTTP protocol just upped it a few notches on the ol' IQ test. As discussed in detail on the Pro Git blog, Git supports a new, much more efficient HTTP based transport as of version 1.6.6. Well, now GitHub supports that new protocol as well.
Smart HTTP Support · GitHub


今までもhttp経由のcloneだけならできましたが、やはり開発者ならpushしたいっすよね。
また、単なるcloneだけをとっても、今回のリリースによってかなり早くなっているように感じました。


なお、pushするときは、

$ git clone https://username1@github.com/username2/project.git

のようにURLにユーザ名を指定する必要があります。
パスワードが流れるのでhttps必須です。そこんとこご注意を。

ちなみにusername1はあなた自身のユーザ名、username2は対象プロジェクトを所有するユーザ名です。

Don't forget the https part - Git will send your password hashed but unencrypted over the wire, so be sure to use SSL. In future versions of Git (assuming our patch gets integrated), Git will prompt you for your username if it's not provided and the client gets a 401, so you won't actually have to put your username in the URL - it will just ask you when Git needs it.

とあるので、git側でパッチをgithub側が提供した適用してくれると、プロンプトでユーザ名を聞いてくれるようになるので、URLに埋め込む必要はなくなるようです。



既存のローカルリポジトリに対しては、

$ git remote set-url origin https://username1@github.com/username2/project.git

こんな感じでremoteで指定しているURLを書き換えてしまえば、継続してつかるようです。

まだpushは試してないですが、"Already up-to-date"とでるだけの空pullをしてみたらエラーも出なくてうまくいったので、これでいけるんじゃないでしょうか。もし何かおかしいようだったら、新たにcloneしなおせば良いでしょう。



いやー、これはホントにうれしい機能です。
素敵すぎます。