google-cloud-platformgoogle-cloud-source-repos

How to clone a particular branch from Google CLoud Source Repository


I am trying to clone a particular branch from Google Cloud Source Repository.

gcloud source repos clone <Repos_Name>

This command only scans the master branch not the dev branch that I am looking for

How to clone the particular brach?


Solution

    1. clone your repo

      gcloud source repos clone <Repos_Name>

    2.fetch remote branch

    git fetch --all
    

    3.checkout your desire branch

    git checkout <remotebranch>