Skip to content

Instantly share code, notes, and snippets.

@danieldogeanu
Last active September 1, 2018 01:32
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 danieldogeanu/d093c7c93e9bff83b250b54111798573 to your computer and use it in GitHub Desktop.
Save danieldogeanu/d093c7c93e9bff83b250b54111798573 to your computer and use it in GitHub Desktop.
How to delete branches from GitHub/BitBucket.
  1. If the branches are only local, you can use -d if the branch has been merged:

    git branch -d branch-name

  2. If the branch contains code you never plan on mergin, use -D instead:

    git branch -D branch-name

  3. If the branch is in the upstream repo you can remove the remote reference by:

    git push origin :branch-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment