main branch. Not added a project yet? Read Add project.
Local and remote branches
A branch can exist in two places. Knowing the difference helps you understand what’s private to you and what’s shared with your team:- A remote branch lives in your Git repository (for example, GitHub, GitLab, Bitbucket, Azure DevOps, or Matillion-hosted Git). Remote branches are shared—anyone with access to the repository can see them and work on them.
- A local branch is a private copy that exists only in your workspace. A local branch is visible only to you until you push it. Pushing a branch for the first time creates it on the remote repository and makes it available to your collaborators.
Add new branch
- In the left navigation, click the Projects icon.
- Select your project.
- Navigate to the Branches tab.
- Click Add new branch.
Click Create to add the new branch, or click the X icon to cancel.
There is no limit to the number of branches you can create in a project. However, we recommend that you delete branches that are no longer needed to keep your project organized.
A new branch is created as a local branch—it exists only in your workspace until you push it. Pushing for the first time creates the branch on your remote repository and makes it available to your collaborators.
View and manage branches
To view the branches in your project:- In the left navigation, click the Projects icon.
- Select your project.
- Navigate to the Branches tab.
- Click the three dots … for that branch and click Edit branch details.
- In the Default environment drop-down menu, select the new default environment for the branch.
Linking a default environment to a branch is optional. A branch’s default environment is a convenience that pre-selects when you open the branch—it’s no longer required, and a branch can have no environment linked at all. When you open a branch in , you can switch to a different environment for your session using the environment drop-down. Switching the environment in doesn’t change the branch’s linked default—the Branches tab is the only place to change that.
Delete a branch
You can delete any branch except the default branch (usuallymain).
- In the left navigation, click the Projects icon.
- Select your project.
- Navigate to the Branches tab.
- Click the three dots … for the branch you want to delete and select Delete branch.
-
If the branch exists on the remote, select what you want to delete:
- Delete local copy—removes your copy of the branch from but leaves the remote branch in place. You can restore your copy later by pulling the branch again, but only work that was already pushed comes back—any commits or changes you hadn’t pushed are permanently lost.
- Delete from the remote repository—removes the branch from your Git repository for everyone with access to it. Your local copy, if you have one, is kept.
- Delete from local and remote—removes both your local copy and the remote branch.
- Confirm the deletion, then click Delete branch. For an option that can’t be undone, you’re asked to type the branch name before you can continue.
Branch protection
Enforcing branch protection rules is highly recommended, especially for yourmain branch or your default branch. This ensures that only approved changes are pushed or merged into your production branch. ’s integration with supported Git providers uses OAuth 2.0. This means that any branch protection rules or permissions that apply to a user will be honored in .
To set up branch protection rules in your Git provider, read the documentation below:
