Downloading a specific branch of App from googlesource

This question already has an answer here:

  • How to clone a single branch in git? 13 answers

  • Git clone download all the project, with --branch option:

    --branch , -b Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to branch instead. In a non-bare repository, this is the branch that will be checked out.

    git clone --branch ics-mr1 https://android.googlesource.com/platform/packages/apps/Gallery2
    

    Hope this helps!


    你克隆这个项目,然后你像这样签出分支:

    git clone https://android.googlesource.com/platform/packages/apps/Gallery2
    cd Gallery2/
    git checkout ics-mr1
    

    You can also download just one branch:

    git init Gallery2_ics-mr1
    cd Gallery2_ics-mr1
    git remote add origin https://android.googlesource.com/platform/packages/apps/Gallery2
    git fetch -n origin ics-mr1:refs/remotes/origin/ics-mr1
    git checkout origin/ics-mr1 -b ics-mr1
    

    Note that further git pull or git fetch (without parameters) will fetch everything else from the repository.

    链接地址: http://www.djcxy.com/p/16040.html

    上一篇: 本地存储库的Git签出版本

    下一篇: 从googlesource下载App的特定分支