Android: ソースツリーのURLが変更された


 ・旧(8/13/2011): git://


$ repo --version
repo version v1.7.7.5
git version 1.7.6
Python 2.6.6 (r266:84292, May 20 2011, 16:42:25) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)]


$ repo --version
repo version v1.7.5
       (from git://
git version 1.7.6
Python 2.6.6 (r266:84292, May 20 2011, 16:42:25) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)]


# curl > /usr/local/bin/repo
# chmod 755 /usr/local/bin/repo
$ repo init -u
$ repo sync

最初に"repo init"コマンドを実行すると、以下のようにホームディレクトリの下にGPGのキーリング(Key Ring)が作成され、repoコマンドの中で変数MAINTAINER_KEYSに設定されている"Repo Maintainer"の公開鍵が格納されます。

$ ls -R ~/.repoconfig
gnupg  keyring-version

pubring.gpg  pubring.gpg~  secring.gpg  trustdb.gpg
$ export GNUPGHOME=~/.repoconfig/gnupg
$ gpg --list-keys
pub   1024D/920F5C65 2008-10-16
uid                  Repo Maintainer 
sub   4096g/D0D7991F 2008-10-16
$ gpg -a --export "Repo Maintainer"
Version: GnuPG v2.0.14 (GNU/Linux)


最初に"repo init"コマンドを実行すると、"*** Please tell me who you are."というメッセージが表示されて、git config コマンドを実行するよう促されるので、その指示に従い以下のコマンドを実行します。(以下の名前とメールアドレスは例です)

$ git config --global ""
$ git config --global "FirstName LastName"
$ cat ~/.gitconfig 
	email =
	name = FirstName LastName
	ui = auto

"repo init"コマンドを実行すると、実行した作業ディレクトリの下に.repoディレクトリが作成され、その下にブランチの情報やHelp付きのrepoのサブコマンドなどが置かれます。

$ ls .repo/manifests.git/refs/remotes/origin
android-1.6_r1    android-2.1_r1      android-2.2_r1.1    android-2.3.5_r1
android-1.6_r1.1  android-2.1_r2      android-2.2_r1.2    android-2.3.6_r0.9
android-1.6_r1.2  android-2.1_r2.1p   android-2.2_r1.3    android-2.3.6_r1
android-1.6_r1.3  android-2.1_r2.1p2  android-2.3.1_r1    android-2.3.7_r1
android-1.6_r1.4  android-2.1_r2.1s   android-2.3.2_r1    android-2.3_r1
android-1.6_r1.5  android-2.2.1_r1    android-2.3.3_r1    froyo
android-1.6_r2    android-2.2.1_r2    android-2.3.3_r1.1  gingerbread
android-2.0.1_r1  android-2.2.2_r1    android-2.3.4_r0.9  gingerbread-release
android-2.0_r1    android-2.2_r1      android-2.3.4_r1    master
$ ls .repo/repo/subcmds
__init__.pyc     diff.pyc      init.pyc      selfupdate.pyc  sync.pyc
abandon.pyc      download.pyc  list.pyc      smartsync.pyc   upload.pyc
branches.pyc     forall.pyc    manifest.pyc  stage.pyc       version.pyc
checkout.pyc     grep.pyc      prune.pyc     start.pyc
cherry_pick.pyc  help.pyc      rebase.pyc    status.pyc


$ repo help --all
usage: repo COMMAND [ARGS]
The complete list of recognized repo commands are:
  abandon      Permanently abandon a development branch
  branch       View current topic branches
  branches     View current topic branches
  checkout     Checkout a branch for development
  cherry-pick  Cherry-pick a change.
  diff         Show changes between commit and working tree
  download     Download and checkout a change
  forall       Run a shell command in each project
  grep         Print lines matching a pattern
  help         Display detailed help on a command
  init         Initialize repo in the current directory
  list         List projects and their associated directories
  manifest     Manifest inspection utility
  prune        Prune (delete) already merged topics
  rebase       Rebase local branches on upstream branch
  selfupdate   Update repo to the latest version
  smartsync    Update working tree to the latest known good revision
  stage        Stage file(s) for commit
  start        Start a new branch for development
  status       Show the working tree status
  sync         Update working tree to the latest revision
  upload       Upload changes for code review
  version      Display the version of repo

See 'repo help ' for more information on a specific command.

$ repo help init
Initialize repo in the current directory
Usage: repo init [options]

・Downloading the Source Tree

・Version Control with Repo and Git

Repo is a repository management tool that we built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system, and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path. In working with the Android source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.