如何在 Android 源代码树中显示可用的分支?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2874347/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:41:12  来源:igfitidea点击:

How to display available branches in Android source tree?

gitandroidandroid-ndkrepository

提问by theactiveactor

Following directions on Android's main website to pull down sources, I'm looking at this command to initialize repo for the cupcake branch:

按照 Android 主网站上的指示下拉源,我正在查看此命令来初始化cupcake 分支的repo:

repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

How can I view all available branches besides cupcake, i.e eclair, donut, etc...?

我如何查看除纸杯蛋糕之外的所有可用分支,即 eclair、甜甜圈等...?

采纳答案by Volker Voecking

It doesn't seem to be possible using the "repo" script, but you can query the list of available branches using git:

使用“repo”脚本似乎不可能,但您可以使用 git 查询可用分支列表:

$ git clone https://android.googlesource.com/platform/manifest.git
$ cd manifest
$ git branch -r

If you don't want to clone the repository just for this, you can see the branches on the web interface.

如果您不想为此克隆存储库,您可以在Web 界面上看到分支。

回答by ?ukasz Sromek

The quickest way to list available branches without cloning/downloading anything is this one-liner:

在不克隆/下载任何东西的情况下列出可用分支的最快方法是这个单行:

$ git ls-remote -h https://android.googlesource.com/platform/manifest.git

回答by Mark Renouf

The manifests are already checked out as part of the repo init process. To get a list of available branches, (from your android repo checkout root), use this command:

清单已经作为 repo init 过程的一部分被检出。要获取可用分支列表(从您的 android repo checkout 根目录),请使用以下命令:

git --git-dir .repo/manifests/.git/ branch -a

回答by Michal Vojtí?ek

See list of "Codenames, Tags, and Build Numbers" at http://source.android.com/source/build-numbers.html

请参阅http://source.android.com/source/build-numbers.html 上的“代号、标签和内部版本号”列表

git access is refused

git 访问被拒绝

回答by alijandro

For the repository you have perform repo sync. You can find them in your local directory .repo/manifests. Suppose you check aospto ~/aosp.

对于您执行的存储库repo sync。您可以在本地目录中找到它们.repo/manifests。假设您检查aosp~/aosp

$ cd ~/aosp/.repo/manifests
$ git branch -r

回答by Tzunghsing David Wong

Assuming at the top of an AOSP tree, a list of tags can be shown either,

假设在 AOSP 树的顶部,可以显示标签列表,

$ git --git-dir .repo/manifests.git tag -l

$ git --git-dir .repo/manifests.git tag -l

or

或者

$ (cd .repo/manifests; git tag -l; )

$ (cd .repo/manifests; git tag -l; )