Search code examples
gitandroid-source

How to clone subbranch from android source?


I am not overly familiar with git. I was trying to download the following branch but I guess this is not the way to do it:

git clone https://android.googlesource.com/platform/packages/apps/Camera/+/jb-mr1.1-release

What I want is the code from this address https://android.googlesource.com/platform/packages/apps/Camera/+/jb-mr1.1-release, but I'm not sure what command to use.


Solution

  • What you want to clone is the files in the branch "jb-mr1.1-release". So, you cannot put your branch in the end of the git's link to clone the files. Git allows you to clone the branch by using the following statement:

    git clone -b <branch> <remote_repo>
    

    In your case: you should use the following:

    git clone -b jb-mr1.1-release https://android.googlesource.com/platform/packages/apps/Camera