Skip to content

Merge Changes to main

Overview

This is a how-to guide on merging your changes into the main branch of your plugin repository.

Use this after you have committed and pushed your changes to a branch and you want to make them part of the main line of development.

Prerequisites

  • You have already pushed your changes to the remote repository.
  • You can access your repository in Gitea.
  • Your branch is ready to be reviewed and merged.

Steps to merge your changes

  1. Open your repository in Gitea, for example:

    https://gitea.psi.ch/bec/<plugin_name>
    
  2. Open the Pull Requests tab.

    NewPullRequest

  3. On the right, click on the New Pull Request button.

    NewPullRequestButton

    This will open the pull request creation page, where you can select the base and compare branches.

  4. Select the base branch (left) as main and the compare branch as your feature branch (right).

    SelectBranches

  5. On the right, click the New Pull Request button to create the pull request.

    CreatePullRequest

  6. Add a title and description for your pull request, then click Create Pull Request again.

    PullRequestDetails

  7. Request a review from your team members. It is always good practice to have at least one other person review your changes before merging. Gitea allows you to request specific reviewers on the pull request page by adding them in the "Reviewers" section. You can also add someone from the BEC team as a reviewer if you want feedback.

    RequestReview

  8. Review your changes carefully.

  9. Make sure all checks pass.

    Checks

    If any checks fail, fix the issues in your branch and push the changes again. The pull request will update automatically. If you need help understanding or fixing failed checks, ask for help from your team or the BEC team.

  10. If your branch is not up to date with main, you may need to update it before merging. You can do this by merging main into your branch or rebasing your branch onto main. After updating, push the changes to the remote repository. Gitea offers a button to update the branch if it is behind main.

    UpdateBranch

  11. Merge the pull request into main.

    MergePullRequest

    After the merge, Gitea may offer to delete the feature branch. This is usually fine if you no longer need it.

Common Pitfalls

  • If the pull request shows unexpected files, go back to your branch and check git status and git diff.
  • If Gitea reports merge conflicts, update your branch with the latest main, resolve the conflicts locally, and push again.
  • If the base branch is not main, double-check the target before merging.

Next Steps

Congratulations!

You have successfully merged your changes into main. You can now deploy the updated repository to your BEC instance.