跳到主要内容

Creating a Pull Request

Pull Requests are a key collaboration tool used to merge code changes into the main branch of a project. Here are the common steps for creating a Pull Request:

  1. Click on "Pull Requests" on the project page and then click "New Pull Request."

    image-20241231152157338

  2. After selecting the source branch (the branch where you made the code changes) and the target branch (the branch you want to merge into), click next.

    image-20241231153416969

  3. On the creation page, fill in the basic information for the PR, including the title and description.

    • The title should be concise and clear, describing the purpose of your Pull Request.
    • In the description, explain why these changes were made and how they impact the project. A clear description helps reviewers better understand your work.

    image-20241231154130856

  4. When creating a PR, you can choose to assign specific individuals for merging and reviewing. Select team members to review your code to ensure timely feedback.

    • Merging Person: Responsible for finally merging the PR, officially incorporating the code into the main branch. Merging permissions are usually executed by administrators or maintainers.

    • Reviewer: Responsible for code review (Code Review) to ensure code quality, adherence to standards, and to identify potential issues. They need read access or higher to view the PR and submit review comments, usually performed by administrators, maintainers, and developers.

    • Approver: Responsible for final approval of the PR, deciding whether to allow the merge. This role often overlaps with that of the reviewer and requires write access or higher, typically performed by administrators, maintainers, and developers.

    image-20241231154944560

  5. Click "Create" to successfully create a PR.