Search code examples
gitgithubversion-controlgoogle-cloud-source-repos

How to Clone a Branch from Github to a New Branch in Google Cloud Source Repository?


So I have a local repository that I've pushed to Github as a new branch, without any trouble, but the next step is to clone that same repository to Google Cloud Source Repository, also as a new branch. This is terribly confusing because I'm unfamiliar with Cloud Source Repository and the documentation doesn't really go into much details w/ regards to setting up branches.

Could someone please help me out with some instructions? Thanks in advance!

Is it easier to go through a different workflow; that is: local -> Cloud Source Repo -> Github?


Solution

  • You can mirror your GitHub repositories in Cloud Source Repositories. With the following steps, commits that you push to the GitHub repository are mirrored into your Cloud Source Repository.

    You can follow the steps that I write you down, but first, don't forget to enable Cloud Source Repositories API :

    1. Go to Open Cloud Source Repositories
    2. Click Add Repository
    3. Connect external repository and Continue
    4. Select your project for the repository or create a new one
    5. Select GitHub

    Once you do this, you will proceed to connect to GitHub, authorizing Google Cloud Platform to have read access to the repository. To do it, you should follow these steps:

    1. Click Connect to GitHub
    2. Sign in with your GitHub account
    3. Click Authorize GoogleCloudPlatform
    4. Select the repository that you would like to mirror
    5. Connect Selected Repository

    Here you have the documentation link about mirroring a GitHub repository, in case you need more detailed information.

    Hope this is what you are looking for!