【问题标题】:How to display available branches in Android source tree?如何在 Android 源代码树中显示可用的分支?
【发布时间】:2011-02-21 21:26:18
【问题描述】:

按照 Android 主网站上的说明拉取源代码,我正在查看此命令来初始化纸杯蛋糕分支的 repo:

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

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

【问题讨论】:

    标签: git android android-ndk repository


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

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

      如果您不想为此克隆存储库,可以在web interface 上查看分支。

      【讨论】:

      • Git web interface 对于那些不想克隆 git 存储库只是为了查看可用分支的人。
      • @CristianCiupitu 您的链接似乎已损坏。这是新链接:android.googlesource.com/platform/manifest
      • @gsingh2011:谢谢!现在我有了在答案中提及位置所需的声誉,这样 cmets 就不会在每次更改时都堆积起来。
      【解决方案3】:

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

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

      【讨论】:

      • manifests git location 的位置好像变了:"git --git-dir .repo/manifests.git/ branch -a"
      【解决方案4】:

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

      git 访问被拒绝

      【讨论】:

        【解决方案5】:

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

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

        【讨论】:

          【解决方案6】:

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

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

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

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2021-10-02
            • 1970-01-01
            • 1970-01-01
            • 2020-11-14
            • 2017-06-23
            • 1970-01-01
            相关资源
            最近更新 更多