<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>易水博客 &#187; git</title>
	<atom:link href="http://easwy.com/blog/archives/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://easwy.com/blog</link>
	<description>关注Linux, Scala, Android, Java, 开源软件和嵌入式系统</description>
	<lastBuildDate>Mon, 12 Mar 2012 02:03:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux使用笔记: 使用代理服务器访问git版本库</title>
		<link>http://easwy.com/blog/archives/use_http_proxy_for_git/</link>
		<comments>http://easwy.com/blog/archives/use_http_proxy_for_git/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 06:40:42 +0000</pubDate>
		<dc:creator>Easwy</dc:creator>
				<category><![CDATA[开源软件]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://easwy.com/blog/?p=986</guid>
		<description><![CDATA[本文介绍了如何穿越http代理服务器访问git版本库。 <a href="http://easwy.com/blog/archives/use_http_proxy_for_git/">Continue reading <span class="meta-nav">&#8594;</span></a><div class="fixed"></div><div id="related_posts"><h3  class="related_post_title">相关文章</h3><ul class="related_post">
<li><a href='http://easwy.com/blog/archives/mount-a-windows-shared-folder-on-linux-with-samba/' rel='bookmark' title='Linux使用笔记: 使用Samba访问windows的共享目录'>Linux使用笔记: 使用Samba访问windows的共享目录</a></li>
<li><a href='http://easwy.com/blog/archives/linux-remote-desktop-by-vnc/' rel='bookmark' title='用VNC实现远程桌面共享(支持Windows, Linux, &#8230;)'>用VNC实现远程桌面共享(支持Windows, Linux, &#8230;)</a></li>
<li><a href='http://easwy.com/blog/archives/proxy-setting-on-linux-console/' rel='bookmark' title='Linux下常用程序的代理服务器(proxy)配置'>Linux下常用程序的代理服务器(proxy)配置</a></li>
</div><div class="fixed"></div>]]></description>
			<content:encoded><![CDATA[<p>
    今天想用git下载<a class="ulink" href="http://eclim.org/" target="_top">eclim</a>的源代码，因为公司的网络使用了代理服务器，无法直接访问git协议所监听端口。幸好github支持http协议的访问。于是，使用下面的命令设置了http proxy:
  </p>
<pre class="programlisting">
export http_proxy=http://my_proxy_server:port </pre>
<p>
    这样设置后，使用git可以访问版本服务器了，但在下载的时候却出现这样的错误：
  </p>
<pre class="programlisting">
$ git clone http://github.com/ervandew/eclim.git

Initialized empty Git repository in /home/easwy/90download/eclim/git/eclim/.git/

got 559057ba6b5133554e9603d400398c0700752c49
walk 559057ba6b5133554e9603d400398c0700752c49
got c177f69b4c5a18c7ee5aab65cdb88fcd410169df
got 1bd4276c2aa8832c8950f3be030e6eddde5a8b56
walk 1bd4276c2aa8832c8950f3be030e6eddde5a8b56
Getting alternates list for http://github.com/ervandew/eclim.git
Getting pack list for http://github.com/ervandew/eclim.git
Getting index for pack 523055f70fe6414d844af3180da0ade0adc95f87
Getting index for pack d338b3e2c4e213d4da51ddc86d898a11242ab9ec
Getting pack 523055f70fe6414d844af3180da0ade0adc95f87
 which contains aaae75262ebffdfa97c584f6b69967b0f5cc8cc8
 error: Unable to get pack file http://github.com/ervandew/eclim.git/objects/pack/pack-523055f70fe6414d844af3180da0ade0adc95f87.pack
 transfer closed with 30775470 bytes remaining to read
 error: Unable to find aaae75262ebffdfa97c584f6b69967b0f5cc8cc8 under http://github.com/ervandew/eclim.git
 Cannot obtain needed blob aaae75262ebffdfa97c584f6b69967b0f5cc8cc8
 while processing commit 1bd4276c2aa8832c8950f3be030e6eddde5a8b56. 

$ /usr/bin/git version
 git version 1.5.2.1 </pre>
<p>
    在网上搜了一下，也有其它人遇到这个问题，好像是git的bug，目前还不知道解决办法。即使换用git版本1.6.6还是存在此问题。难怪网上有人建议尽量不要使用http协议访问git版本库，除非你位于防火墙后面，可我恰好就是这种情况，郁闷ing!
  </p>
<p><span class="bold"><strong>2010/1/13更新</strong></span></p>
<p>
    网友ufly提到可以使用corkscrew来访问git版本库，<a class="ulink" href="http://easwy.com/blog/" target="_top">Easwy</a>按照文章<a class="ulink" href="https://gforge.ti.com/gf/project/omapandroid/wiki/?pagename=Git+Firewall" target="_top">Git Firewall</a>里讲的试了一下，还是不成功。
  </p>
<p>
    这可能是公司所用的代理服务器的限制，比如，当我尝试通过corkscrew进行ssh访问时，代理服务器会返回下面的信息：
  </p>
<pre class="programlisting">
$ ssh easwy@remote-server
Proxy could not open connnection to remote-server:  ( The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests.  )
ssh_exchange_identification: Connection closed by remote host </pre>
<p>
    也就是说，公司的http proxy限制了通过SSL访问的端口只能是443端口，如果不是443端口则拒绝连接。
  </p>
<p>
    幸好github.com也开通了443端口的访问，文章<a class="ulink" href="http://blog.codeslower.com/2008/8/Using-PuTTY-and-SSL-to-securely-access-GitHub-repositories-via-SSH" target="_top"> Access GitHub repositories from work (take that, firewall!).</a>及其后的评论介绍了如何在windows及Linux下穿越防火墙访问github.com。等有时间试一下。
  </p>
<p>
    更多内容，请阅读<a class="ulink" href="http://easwy.com/blog/" target="_top">Easwy的博客</a>上的其它文章。
  </p>
<div class="posturl">
<p><span class="bold"><strong>原创文章，请阅读页脚的<a href="#license">许可方式</a>，转载请注明：</strong></span>转载自<a class="link" href="http://easwy.com/blog/" target="_top">易水博客</a> [ <a class="link" href="http://easwy.com/blog/" target="_top">http://easwy.com/blog/</a> ]</p>
<p><span class="bold"><strong>本文链接地址:</strong></span> <a class="link" href="http://easwy.com/blog/archives/use_http_proxy_for_git/" target="_top">http://easwy.com/blog/archives/use_http_proxy_for_git/</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
<div class="fixed"></div><div id="related_posts"><h3  class="related_post_title">相关文章</h3><ul class="related_post">
<li><a href='http://easwy.com/blog/archives/mount-a-windows-shared-folder-on-linux-with-samba/' rel='bookmark' title='Linux使用笔记: 使用Samba访问windows的共享目录'>Linux使用笔记: 使用Samba访问windows的共享目录</a></li>
<li><a href='http://easwy.com/blog/archives/linux-remote-desktop-by-vnc/' rel='bookmark' title='用VNC实现远程桌面共享(支持Windows, Linux, &#8230;)'>用VNC实现远程桌面共享(支持Windows, Linux, &#8230;)</a></li>
<li><a href='http://easwy.com/blog/archives/proxy-setting-on-linux-console/' rel='bookmark' title='Linux下常用程序的代理服务器(proxy)配置'>Linux下常用程序的代理服务器(proxy)配置</a></li>
</div><div class="fixed"></div>]]></content:encoded>
			<wfw:commentRss>http://easwy.com/blog/archives/use_http_proxy_for_git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

