Quick Start

更新时间:
复制 MD 格式

This topic helps you get started with Apsara DevOps Codeup.

Prerequisites

  1. Install Git on your local machine to use the command line. For more information, see Install Git.

  2. To clone and commit code using the Secure Shell (SSH) protocol, configure an SSH public key for your platform account. For more information, see Configure an SSH key.

Background information

You can access Apsara DevOps Codeup from the following entry points:

Step 1: Create your first repository

  1. Log in to Apsara DevOps Codeup and click New Repository in the upper-right corner of the home page.

  2. In the dialog box that appears, configure the following parameters:

    • Repository Name: The name of the repository. The name can contain letters, digits, underscores (_), periods (.), and hyphens (-). It must start with a letter, digit, or underscore (_).

    • Specify the code repository path.

    • Visibility: The visibility of the repository. An organization-public repository is visible to all members of the organization, except for external members. A private repository is visible only to its members. For more information, see Platform permission settings.

    • Description: A brief description of the repository.

    • Configure advanced initialization options, such as readme, .gitignore, and storage encryption.

  3. Click OK to create your first repository.

    Note

    If you use another code hosting platform, you can use the code import feature of Apsara DevOps to quickly import code. For more information, see Migrate or import a third-party repository.

Step 2: Commit your first line of code

Apsara DevOps Codeup supports two methods for committing code: committing code on the web or from a local Git client.

Commit code on the web

  1. Navigate to the repository that you created.

  2. Select a file, such as README.md, and click the Edit button in the upper-right corner.

  3. Modify the content and click Save. For example, you can add content to the end of the README.md file.

    // Explain the purpose of the readme document
    >The readme document contains the description of the code repository
  4. In the dialog box that appears, enter a commit message.

    Enter a title and a detailed description for the commit to explain the reason for the change. If you leave this field blank, a default commit message is used.

    Note

    The title of the commit message must be in English, must not exceed 50 bytes in length, and must not end with a period (.).

  5. Click Commit Now to commit the file changes to the specified branch, such as the master branch.

  6. Verify the result. In the navigation pane on the left of the repository, click Commits to check whether your changes are committed to the repository.

Commit code from a local Git client

You must install Git to use it locally. For more information, see Install Git.

Clone the code to your local machine

  1. Navigate to the repository that you created.

  2. In the upper-right corner of the repository's home page, click Clone/Download to obtain the clone URL.

    You can clone the repository using SSH or HTTPS. The clone URL varies based on the protocol that you select.

  3. Clone the repository.

    1. To clone the repository using the HTTPS protocol:

      Note

      Before you clone a repository for the first time, you must configure a username and password for cloning. For more information, see Configure an HTTPS password.

      • On the repository page, select HTTPS and copy the URL.

      • In Git Bash, run the clone command.

        git clone https://codeup.aliyun.com/your-company/xxx.git # Replace with the repository URL you copied

        When prompted by the terminal, enter the username and password that you configured.

    2. To clone the repository using the SSH protocol:

      Note

      Before you clone a repository for the first time, you must configure an SSH public key. For more information, see Configure an SSH key.

      • On the repository page, select SSH and copy the URL.

      • In Git Bash, run the clone command.

        git clone gi*@codeup.aliyun.com:your-company/xxx.git # Replace with the repository URL you copied

        The terminal automatically finds the available public and private key files, establishes an SSH connection with the remote server, and clones the repository.

Modify and push code locally

  1. Add your local file changes, such as modifications, additions, or deletions, to the Git index. For example, you can create a file named hello.java in your local repository and run the git add command to instruct Git to track the version changes of this file.

    git add hello.java
  2. Create a new commit.

    Run the git commit command to commit the changes that are recorded in the index to the repository.

    git commit -m "add hello.java" # Write the commit message in the double quotation marks
  3. Push the changes from your local repository to the remote repository.

    For example, to push the changes to the remote master branch, run the following command:

    git push
  4. Verify the result.

    Go to the destination repository and refresh the page. You can view the push record and the changes that are synchronized from your local machine, including the newly added hello.java file.

Step 3: Invite members to collaborate

The repository administrator is responsible for inviting members.

  1. In the navigation pane on the left of the destination repository, click Members to view member information.

  2. Code repository administrators can add members.

    • You can search for all members of the current organization by username. Members who have already joined the repository are selected by default.

    • If a user has not joined the organization, you must invite the user to become an organization member before you can add the user to the repository. For more information, see Organizations.

    • Select the members that you want to add and assign roles to them.

    • You can add members by department and enable automatic synchronization of personnel changes. This way, you do not need to manually modify member permissions in the repository when members are added to or removed from a department.

Step 4: Enable code scanning

Codeup provides a built-in code scanning service to help you manage your code assets during development. Click New Scan Task. In the New Scan Task dialog box, select a scanning scheme. For more information, see Use the code scanning service. For the trigger method, you can select either Commit Trigger or Merge Request Trigger. After the configuration is complete, scans are automatically triggered and the results are returned promptly.

Step 5: Use code review

Apsara DevOps Codeup provides a collaborative code review service. After you finish developing a feature, you can create a merge request. The specified owners can then review your code through an approval process to continuously monitor code quality.

  1. Configure rules for Branch Settings and Merge Request Settings. For more information, see Branch settings and Merge request settings.

  2. Create a merge request to initiate a code review.

  3. After the merge conditions are met, merge the code.