git delete local branch without remote code example
Example 1: git delete local branch
// delete branch locally
git branch -d localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
Example 2: delete local branches not on remote
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D
Example 3: git delete branches that aren't on remote
git fetch --all --prune
Example 4: git delete remote branch
git push -d <remote_name> <branch_name>
git branch -d <branch_name>
Example 5: git branch delete remote
$ git push origin --delete feature/login