<?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>William Hua的Blog &#187; Repo</title>
	<atom:link href="http://www.williamhua.com/tag/repo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.williamhua.com</link>
	<description>一个关于生活感悟、新奇见闻、互联网和消费电子的Blog</description>
	<lastBuildDate>Mon, 04 Jul 2011 01:29:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Git和Repo扫盲——如何取得Android源代码</title>
		<link>http://www.williamhua.com/2009/04/git-and-repo-for-dummies/</link>
		<comments>http://www.williamhua.com/2009/04/git-and-repo-for-dummies/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 02:43:49 +0000</pubDate>
		<dc:creator>William Hua</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[开源技术]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitWeb]]></category>
		<category><![CDATA[Repo]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[分布式版本控制]]></category>

		<guid isPermaLink="false">http://www.williamhua.com/?p=140</guid>
		<description><![CDATA[Git 是 Linux Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的分布式版本控制软件，它不同于Subversion、CVS这样的集中式版本控制系统。在集中式版本控制系统中只有一个仓库（repository），许多个工作目录（working copy），而像Git这样的分布式版本控制系统中（其他主要的分布式版本控制系统还有BitKeeper、Mercurial、GNU Arch、Bazaar、Darcs、SVK、Monotone等），每一个工作目录都包含一个完整仓库，它们可以支持离线工作，本地提交可以稍后提交到服务器上。分布式系统理论上也比集中式的单服务器系统更健壮，单服务器系统一旦服务器出现问题整个系统就不能运行了，分布式系统通常不会因为一两个节点而受到影响。 因为Android是由kernel、Dalvik、Bionic、prebuilt、build等多个Git项目组成，所以Android项目编写了一个名为Repo的Python的脚本来统一管理这些项目的仓库，使得Git的使用更加简单。 这几天William为了拿Android最新的sourcecode，学习了一下git和repo的一些基本操作，整理了一个如何取得Android代码的How-To，今天把他贴上来。 1、Git的安装 在Ubuntu 8.04上安装git只要设定了正确的更新源，然后使用apt-get就可以了，有什么依赖问题，就让它自己解决吧。其中cURL是一个利用URL语法在命令行下工作的文件传输工具，会在后面安装Repo的时候用到。 sudo apt-get install git-core curl 2、安装Repo 首先确保在当前用户的主目录下创建一个/bin目录（如果没有的话），然后把它(~/bin)加到PATH环境变量中 接下来通过cURL来下载Repo脚本，保存到~/bin/repo文件中 curl http://android.git.kernel.org/repo >~/bin/repo 别忘了给repo可执行权限 chmod a+x ~/bin/repo 3、初始化版本库 如果是想把Android当前主线上最新版本的所有的sourcecode拿下来，我们需要repo的帮助。 先建立一个目录，比如~/android，进去以后用repo init命令即可。 repo init -u git://android.git.kernel.org/platform/manifest.git 这个过程会持续很长的时间（至少可以好好睡一觉），具体要多少时间就取决于网络条件了 最后会看到 repo initialized in /android这样的提示，就说明本地的版本库已经初始化完毕，并且包含了当前最新的sourcecode。 如果想拿某个branch而不是主线上的代码，我们需要用-b参数制定branch名字，比如： repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake 另一种情况是，我们只需要某一个project的代码，比如kernel/common，就不需要repo了，直接用Git即可。 git clone git://android.git.kernel.org/kernel/common.git 这也需要不少的时间，因为它会把整个Linux [...]]]></description>
		<wfw:commentRss>http://www.williamhua.com/2009/04/git-and-repo-for-dummies/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
	</channel>
</rss>

