How to create new local branch in git?

Member

by domenico , in category: Third Party Scripts , 5 months ago

How to create new local branch in git?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 5 months ago

@domenico 

To create a new local branch in Git, you can use the following command:

1
git checkout -b <branch_name>


This command creates a new branch with the specified name and switches to that branch. Alternatively, you can also use the following commands to achieve the same result:

1
2
git branch <branch_name>
git checkout <branch_name>


After creating the branch, you can start making changes and committing them to the new branch.