Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

general

How to delete a local branch in git

Sarvech Qadir

You can delete any local branch on GitHub.

Delete the branch by typing:

git branch -d <branch_name>

branch_name is the name of the branch you want to delete.

Note: Use -d if the branch has already been pushed and merged with the remote branch. Else, use -D.

If you want to delete the current branch, be sure to checkout to another branch by typing:

git checkout master

Then, delete the branch using:

git branch -d <branch_name> 

RELATED TAGS

general

CONTRIBUTOR

Sarvech Qadir
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring