By default, Builder Projects have a Commit Mode of Direct Commits. This means that changes pushed to the repository will be added to the main branch of that repository.
Builder supports branching for both cloud repositories, such as GitHub, as well as branching within Builder.
To create branches and pull requests from your Project, you must first ensure your Project has enabled them.
To enable branching and pull requests for your Project:
- On your main Projects page, click the three-dot menu for your Project.
- Choose Project Settings.
- Go to the Advanced tab.
- Under Commit Mode, choose the Pull Requests option.
- Click Save.
You should now see that you can create a new branch. Use the + New Branch whenever you create new features.
By default, when using the + New Branch button, the created branch uses your main branch as its base.
To enable other remote branches to be used as the base branch for your Project:
- On your main Projects page, click the three-dot menu for your Project.
- Choose Project Settings.
- Scroll down to the Main Branch Name section.
- Select the option enabling base branch selection when creating new branches.
- Click Save.
Now when you click + New Branch, you are prompted to first choose your base branch.
After configuring your Project to allow pull request:
- Go to the Projects page.
- Locate your Project and click + New Branch.
This creates a new Project, using your code repository as its base.
To create a pull request after making changes to your Project, click the Create PR button. After clicking, Builder generates the pull request and then opens a new tab, directing you to your pull request.
Share your pull request with your team to get feedback and potentially merge your changes into your live application.
To duplicate your branch:
- Click the three-dot menu at the top-right of the Visual Editor.
- Choose Duplicate Branch.
This will create a new branch, but include the current changes you've made to your Project.