Sangram Barge

How to Delete Branch in Git Locally and Remotely

December 06, 2020

Many times we create a branch and we don’t need it later, in this post I have shared how to delete a git branch locally or remotely. I prefer to use CLI so I use git bash for doing this activity.

Command for Deleting Branch in Git Locally

The below command will delete your local branch. No need to worry your remote branch is still safe.

git branch -d <yourbranchname>

In order to delete your remote branch in git you can use below command.

git push origin —delete <yourbranchname>

After you execute the above command, you will no longer be able to find the branch present in remote repository.

If this post helped you, make sure you tweet about it so it can be helpful for others.


© 2024 Made with ❤️ in India. Twitter