2010年8月31日星期二

在cygwin下设置repo和同步

1. 安裝Cygwin,以及要安裝的packages如下:
  • Net -> curl
  • Devel -> git* (git, git-completion, git-gui, gitk)
  • Libs -> libreadline6, libiconv2
  • Editors -> vim
  • Python -> python
  • openssh
  • bzip2
2. 啟動Cygwin之後,開始安裝Repo
  • 先在使用者的家目錄新增bin目錄
    $ cd ~
    $ mkdir bin
  • 下載Repo到bin目錄裡
    $ curl http://android.git.kernel.org/repo >~/bin/repo
    $ chmod a+x ~/bin/repo
3. 增加proxy
  • 下载http://bent.latency.net/bent/git/goto-san-connect-1.85/src/connect.html
  • 可以直接下载connect.exe, 也可以自己build,只是需要在cygwin安装GCC
  • 在~/bin下创建文件http-proxy-gw
#!/bin/sh
# Filename: ~/bin/http-proxy-gw
# This script connects to an HTTP proxy using connect.c
connect -H mygate.at.com:1080 $@
  • ~/.gitconfig配置,也可以用命令行设置
[core]
gitproxy = /home/vettey/bin/http-proxy-gw for kernel.org
gitproxy = /home/vettey/bin/http-proxy-gw for omapzoom.org
gitproxy = /home/vettey/bin/http-proxy-gw for codeaurora.org

[color]
ui = auto
[user]
name = vettey
email = vettey.gxy@gmail.com

3. 同步
  • $ cd ~
    $ mkdir mydroid
    $ cd mydroid
    $ ~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git
  • $ repo sync
注意:
以上创建的文件必须是unix格式,否则会出错
.gitconfig and http-proxy-gw should be in unix format, otherwise it will cause error.

Reference:
1. http://ranger1976.blogspot.com/2009/07/windowsandroid.html

没有评论:

发表评论

关注者