Skip to content

Instantly share code, notes, and snippets.

@oclero
Created November 12, 2023 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oclero/349fcc92ae2302a3d33eada7a3a868bb to your computer and use it in GitHub Desktop.
Save oclero/349fcc92ae2302a3d33eada7a3a868bb to your computer and use it in GitHub Desktop.
Remove a Git branch, local and/or remote
# Remove a remote branch.
git push <remote> --delete <branch>
# Remove a local branch.
git branch --delete <branch>
git branch --delete --force <branch>
# Remove a local tracking branch.
git branch --delete --remotes <remote>/<branch>
git fetch <remote> --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment