Get started with Bitbucket Cloud
New to Bitbucket Cloud? Check out our get started guides for new users.
Branching offers a way to work on a new feature without affecting the main codebase. After you make changes, push your branch to Bitbucket Cloud so that you can get it reviewed in a pull request.
If you want to create a Git branch, the best way to do it is from Bitbucket.
From the repository, select the Create button.
Select Branch under the This repository section of the dropdown menu.
From the popup that appears, select a Type (if using the Branching model), enter a Branch name and click Create.
Note: Whenever you create a branch from Bitbucket or from an issue in Jira, Bitbucket removes characters that are invalid in references, file systems or shell, and replace them with a valid substitute.
After you create a branch, you need to check it out from your local system. Use the fetch and checkout commands that Bitbucket provides, similar to the following:
$ git fetch && git checkout <feature>
Make your changes locally and then add, commit, and push your changes to the <feature> branch:
1
2
3
$ git add .
$ git commit -m "adding a change from the feature branch"
$ git push origin <feature>
Click the Source page of your repository. You should see both the main and the <feature branch in the branches dropdown. When you make commits to the feature branch, you'll see the files specific to that branch.
Was this helpful?