android.git.kernel.org[0: 199.6.1.176]: errno=Connection timed out
android.git.kernel.org[0: 204.152.191.45]: errno=Connection timed out
android.git.kernel.org[0: 130.239.17.12]: errno=Connection timed out
android.git.kernel.org[0: 149.20.20.141]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
找各种原因,可能是局域网ISP将Git的端口9418给封了,因为http://android.git.kernel.org是可以访问的。后来搜了一下知道很多git服务器同时提供端口80的下载。
解决方法如下:
1.将命令行中的git://android.git.kernel.org换成http://android.git.kernel.org,
2.修改文件repo将里面的
REPO_URL='git://android.git.kernel.org/tools/repo.git' 改成
REPO_URL='http://android.git.kernel.org/tools/repo.git'
3. 修改文件.repo/manifests/default.xml将其中的 fetch="git://android.git.kernel.org/" 改成
fetch="http://android.git.kernel.org/"
这样就可以下载同步Android的源代码了
normal:
[zhoudy@zdyhost linux]$ git clone git://android.git.kernel.org/kernel/common.git
Cloning into common...
remote: Counting objects: 1823867, done.
remote: Compressing objects: 100% (284389/284389), done.
转自:http://apps.hi.baidu.com/share/detail/34009798
注释:这样其实只能下载和安装repo.
在使用
repo sync
命令下载android源代码之前,需要修改.repo/manifests/default.xml
将其中的 fetch="git://android.git.kernel.org/" 改成
fetch="http://android.git.kernel.org/"
.repo目录就在当前目录下,隐藏的,用ls -la可以列出,或用find / -name .repo查找