Git branches are important part of you daily development process, but once you or your team are finished with a feature and have merged it into your remote’s master branch, you would want to delete that branch from local repo as well 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>
git branchcommand 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."