Creating a Repository

Create code repositories in the DevOps service.

Each service in Oracle Cloud Infrastructure (OCI) integrates with Identity and Access Management (IAM) for authentication and authorization. To grant users permission to access the DevOps code repositories and other resources, you have to create dynamic groups and IAM policies.

For creating dynamic groups and policies for code repositories, see Code Repository Policies. For more details, see DevOps IAM Policies.

An authentication (auth) token is required for each user who uses Git to interact with the code repositories in Oracle Cloud.

Before you create a code repository, you must have a DevOps project.

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. Select a project and from the left-side menu, click Code Repositories.
    3. Click Create Repository.
    4. In the Create repository panel, provide the following information:
      1. Enter a name and description for the repository. Entering a description is optional.
      2. Enter a default branch name.
        If the value is not provided, then the branch is named as "main".
      3. (Optional) To add tags to the repository, click Show tagging options.

        Tagging is a metadata system that lets you organize and track the resources in your tenancy.

        If you have permissions to create a resource, you also have permissions to add free-form tags to it.

        To add a defined tag, you must have permissions to use the tag namespace.

        For more information, see Resource Tags.

    5. Click Create Repository.
      An empty code repository is created on the main branch.

    To add files to the repository, you must clone the repository. For more information, see Cloning a Repository.

  • To create a code repository, run the create command:

    oci devops repository create --name --project-id --repository-type

    To view a list of repositories, run the list command:

    oci devops repository list --compartment-id or --project-id

    To view a list of commits, run the list-commits command:

    oci devops repository list-commits --repository-id

    To get all the commands for repository:

    oci devops repository -h
  • To create a code repository, use the CreateRepository operation.

    To view a list of commits to the repository, use the ListCommits operation.

    To view a list of repositories, use the ListRepositories operation.