Creating an empty repository

You can use Cloud Source Repositories to create a new, empty repository. This is useful in situations where you are just starting a project or have an existing Git repository that you want to back up using Cloud Source Repositories.

Before you begin

Before creating a new repository, verify that you have completed the prerequisite steps including enabling the Cloud Source Repositories API.

Creating a new repository

To create a new repository:


  1. Open Cloud Source Repositories in the console:

Open Cloud Source Repositories

  1. Click Add Repository, located in the top right corner.

    The New Repository screen opens.

  2. Select Create New Repository.

  3. Click Continue.

    The Create New Repository screen opens.

  4. Type a name for the new repository in the Repository Name box.

  5. Select the GCP project the repository belongs to from the Project list.

    To create a new project, click Create Project.

  6. Click Create.

After you create your repository, a new screen opens. This screen provides instructions on how to clone the repository to your local machine or push code from an existing repository.


From the command line, call:

gcloud init
gcloud source repos create REPO_NAME

Creating a project

All repositories must belong to a GCP project. If you don't have an existing project for a repository, you can create one from the New Repository screen.

To create a new project:

  1. From the New Repository screen, type a name for your new repository.

  2. Click Create Project.

    The Create Cloud Project dialog box opens.

  3. Type a name for the new project in the Project Name box.

  4. In the Project ID box, either accept the generated project ID or type a new one.

  5. Select a billing account from the Billing Account list.

    To create a new billing account, click Create Billing Account.

  6. Click Create.

You can now continue to create a new repository.

What's next

Now that you have a new repository in Cloud Source Repositories, your next step is to add code. You can either:

Trang này có hữu ích không? Hãy cho chúng tôi biết đánh giá của bạn:

Gửi phản hồi về...

Cloud Source Repositories Documentation