ItSolutionStuff.com

How to Create a New Branch on GitHub?

By Hardik Savani • November 6, 2024
Git

Here, I will show you how to create branch using git command. I would like to show you git create new branch from master. I would like to show you github create new branch command line. This post will give you simple example of git create new branch using command line.

In this tutorial, we will use git checkout command for creating new branch in github repository. we will use git command to create branch into github. so let's follow the below step to create branch in git.

Clone Git Repository(Optional):

If you are new and you haven't create or clone github repository yet then you can follow bellow tutorial:

Github Create or Clone Git Repository.

Create New Branch using Git Command:

Here, i will give you git command to create new "dev" branch in github. let's see below syntax and example with output:

Syntax:

git checkout -b <branch-name>

Example:

git checkout -b dev

You can see below layout:

Let's see created new branch in Github Repository List:

Output:

I hope it can help you...

Tags: Git
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Ignore Wildcard Files Name in Git using Gitignore?

Read Now →

How to Ignore Folder in Git using Gitignore?

Read Now →

How to Ignore File in Git using Gitignore?

Read Now →

How to Git Ignore Some Files Locally?

Read Now →

How to Clone a Git Repository into a Specific Folder?

Read Now →

How to Merge Your Branch to main Branch in Github?

Read Now →

Git Command to Ignore File Permission Changes

Read Now →

Git - How to Find a Deleted File in Commit History?

Read Now →

How to Configure Git Username and Email?

Read Now →

How to Git Force Pull from Remote Branch?

Read Now →