DEV Community

Vishal Yadav
Vishal Yadav

Posted on

How to delete the branch and create the new branch

For example:
This given command for go to main branch or I can also say that this command is use for changing the branch.

git checkout <branch name in which you go back>
Enter fullscreen mode Exit fullscreen mode

Delete a branch with

git branch -d <branch name>
Enter fullscreen mode Exit fullscreen mode

for creating the new branch in the main or master branch I can use the given command.

git branch -b <branch name>
Enter fullscreen mode Exit fullscreen mode

Done☺
.

IF you want to know more how to contribute on the opensource code on github

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs