_Basics of Branching

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

Branching offers a way to work on a new feature without affecting the main code line. You can branch on a local repository and make changes without ever making that branch visible in Bitbucket Cloud. Or you can push a branch up to Bitbucket so other repository users can access and work with your changes.

There are a number of ways to branch a repository this documentation only shows you the very basic ways to branch. Review your Git or Mercurial resources to get fancy with branching. From a Bitbucket perspective, you have to do some extra work to get a branch to appear:

GitMercurial
Clone a repository to your local system.Clone a repository to your local system.
Create a branch on your local system.
git branch BRANCH_NAME

Create a named branch.
hg branch NAME

Push the branch to Bitbucket.
git push origin BRANCH_NAME

Push the repository to Bitbucket.
hg push --new-branch

Git branches always have a name. Mercurial has the concept of branch and named branch. (Steve Losh's guide is a good resource explaining branching in the two systems).

 

Last modified on Jun 23, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.