Create and duplicate branches
Builder Code
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.
Configure your Project
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 Git tab.
- Under Commit Mode, choose Pull Requests or Draft Pull Requests.
- Click Save.
You can now create a new branch. Use the + New Branch button whenever you create new features.
Customize your base branch
Enterprise plans
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.
- Go to the Git tab.
- Scroll down to the Main Branch Name section.
- Select the option enabling base branch selection when creating new branches.
- Click Save.
This option isn't available when Commit Mode is set to Direct Commits.
Now when you click + New Branch, you are prompted to first choose your base branch.
Create a new branch on your Project
After configuring your Project to allow pull requests:
- Go to the Projects page.
- Locate your Project and click + New Branch.
This creates a new branch in your Project, using your repository's main branch as its base.
Create a pull request
To create a pull request after making changes to your Project, click the Send PR button. After clicking, Builder Code 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.
Duplicate a Project branch
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.