From f2844aee9f27043910683301846e4843d1fb3bb9 Mon Sep 17 00:00:00 2001 From: Filip Vanden Eynde <47209284+filipve1994@users.noreply.github.com> Date: Tue, 7 Jan 2020 10:55:21 +0100 Subject: [PATCH] Update git-branch.md to delete a remote branch, you have to add the parameter --delete https://www.educative.io/edpresso/how-to-delete-remote-branches-in-git --- git-branch.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-branch.md b/git-branch.md index da3ad10a6b..0a22008e01 100644 --- a/git-branch.md +++ b/git-branch.md @@ -56,12 +56,17 @@ List outdated branches that have been merged into the current one. git branch -D $branchname ``` -Delete a branch irrespective of its merged status. +```bash +git branch -d $branchname +``` + +> Note: You can also use the -D flag which is synonymous with --delete --force instead of -d. This will delete the branch regardless of its merge status. +> Delete a branch irrespective of its merged status. ### Delete remote branch ```bash -git push origin :$branchname +git push origin --delete :$branchname ``` Works for tags, too!