May 12, 2022    Share on: Twitter | Facebook | HackerNews | Reddit

How to delete a Git branch locally and remotely?

delete branch locally

git branch -d localBranchName

use -D to force removing not fully-merged branches

delete branch remotely

git push origin --delete remoteBranchName

see also: [[git_delete_branches_merged_into_main_branch]]



Tags:  branch delete git