Git branches are an essential part of your daily development process, but once you or your team have finished with a feature and merged it into your remote's master branch, you would want to delete it from the local and as your remote. You can do it in two ways:
git push --delete <remote_name> <branch_name>
To delete a local branch, use the following:
git branch -d <branch_name>
Note:
-doption forgit branchthe command is an alias of--deleteflag, which deletes the branch if it has already merged in its upstream branch.-Dis also an option--deleteflag, which deletes the branch "regardless of its merged status."