Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. How to use Git
  6. How to use branching in Git
  7. Create a branch
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Create a branch

Creating a branch in Git empowers you to work on new features, tackle bug fixes, or experiment with changes without jeopardizing the stability of the main codebase. Think of branches as isolated workspaces where you can freely make changes, commit your work, and collaborate with others, all while keeping the main branch intact.

In this part of our tutorial, you will create a new branch in Git and start working on your own line of development.

Use the git branch command to create your first new branch and name it issue1.

$ git branch issue1

If you do not specify any parameters, the branch command lists all branches corresponding to the repository. The asterisk indicates the active branch.

$ git branch
issue1
* main

Now, the history looks like this:

Current history

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life