DEV Community

Jasur Kurbanov
Jasur Kurbanov

Posted on

How To Create A New Branch With Git Using Terminal

In this post I will show how to create a new branch with git using VS Code.

Before creating new branch, your branch needs to be up-to-date with latest changes. So, first you need to pull latest changes from remote branch.

git pull
Enter fullscreen mode Exit fullscreen mode

Now you can create new branch and switch to that branch

git checkout -b [name_of_your_new_branch]
Enter fullscreen mode Exit fullscreen mode

Once, you created new branch. It is time to push to Github.

git push origin [name_of_your_new_branch]
Enter fullscreen mode Exit fullscreen mode

New branch successfully created and uploaded.

Information obtained from Kunena-Forum:

Oldest comments (0)