Setting Up a Repository

You can use Google Cloud Source Repositories to create a new, empty repository. This is useful in a variety of situations, such as when you have an existing Git repository and you want to back it up using Cloud Source Repositories.

Before you begin

Select or create a GCP project.

Go to the Manage resources page

Creating a new repository

To create a new repository:


  1. Open the source view in the console:

    Open the Source View in the Console

  2. Click Repositories in the left-hand navigation bar.

  3. Click Create Repository.

    Create Repository button

  4. Enter a name for the repository when prompted and click Create.


From the command line, call:

gcloud init
gcloud source repos create REPO_NAME

The response looks like:

Created [<Repo
 createTime: u'2016-06-02T00:43:16.978546Z'
 id: u'vhgpLUdCAVc'
 name: u'myrepo'
 projectId: u'google-cloud-example'
 state: StateValueValuesEnum(LIVE, 1)
 vcs: VcsValueValuesEnum(GIT, 1)>].
createTime: '2016-06-02T00:43:16.978546Z'
id: vhgpLUdCAVc
name: myrepo
projectId: google-cloud-example
state: LIVE
vcs: GIT

What's next

After you have set up a GCP repository, you might find the following topics helpful:

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Source Repositories