git remove remote branches code example
Example 1: delete branch from remote
// delete branch locally
git branch -d localBranchName
//delete local branch that is unmerged
git branch -D localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
Example 2: git remove remote
$ git remote -v
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
> destination https://github.com/FORKER/REPOSITORY.git (fetch)
> destination https://github.com/FORKER/REPOSITORY.git (push)
$ git remote rm destination
$ git remote -v
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
Example 3: git how to delete origin branch
$ git push origin --delete feature/login
Example 4: delete branch
// delete branch locally
git branch -D localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
Example 5: how to delete a branch git
// delete branch locally
git branch -d localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
Example 6: Delete a Git Branch In Local And Remotely
git push <remote_name> --delete <branch_name>