If the branches are only local, you can use -d if the branch has been merged, like
git branch -d branch-name
If the branch contains code you never plan on merging, use -D instead.
If the branch is in the upstream repo (on Bitbucket) you can remove the remote reference by
git push origin :branch-name
Also, if you’re on the Bitbucket website, you can remove branches you’ve pushed by going to the Feature branches tab under Commits on the site. There you’ll find an ellipsis icon. Click that, then choose Delete branch. Just be sure you want to drop all the changes there!
Related Posts:
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- How do I rename a local Git branch?
- What is the best (and safest) way to merge a Git branch into master?
- How to remove local (untracked) files from the current Git working tree
- Git merge hotfix branch into feature branch
- Git fetch remote branch
- How do I clone a specific Git branch? [duplicate]
- Git fetch remote branch
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How to get just one file from another branch?
- Update Git branches from master
- Create a branch in Git from another branch
- How do I rename both a Git local and remote branch name?
- Create Git branch with current changes
- How to get the current branch name in Git?
- How do you create a remote Git branch?
- Move the most recent commit(s) to a new branch with Git
- Move the most recent commit(s) to a new branch with Git
- Make an existing Git branch track a remote branch?
- How do I call git diff on the same file between 2 different local branches?
- How to get the current branch name in Git?
- How do you create a remote Git branch?
- Branch from a previous commit using Git
- Not a valid object name: ‘master’
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - How do I copy a version of a single file from one Git branch to another?
- Updates were rejected because the remote contains work that you do not have locally
- Move existing, uncommitted work to a new branch in Git
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- SourceTree keeps asking for Github password
- How do I push a local Git branch to master branch in the remote?
- How to keep a branch synchronized/updated with master?
- How do I run git log to see changes only for a specific branch?
- How to create a local branch from an existing remote branch?
- How to find which git branch I am on when my disk is mounted on other server
- How to create a new branch from a tag?
- Git refusing to merge unrelated histories on rebase
- What is the difference between git push origin and git push origin master
- git – remote add origin vs remote set-url origin
- How do I undo ‘git add’ before commit?
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- How can I see the differences between two branches?
- How to upgrade Git on Windows to the latest version
- Need to reset git branch to origin version
- git: fatal: Could not read from remote repository
- Windows git “warning: LF will be replaced by CRLF”, is that warning tail backward?
- How to fetch all Git branches
- How to change the URI (URL) for a remote Git repository?
- What would I use git-worktree for?
- Git error when trying to push — pre-receive hook declined
- How do I revert all local changes in Git managed project to previous state?
- How to revert multiple git commits?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- fatal: The current branch master has no upstream branch
- You have not concluded your merge (MERGE_HEAD exists)
- How to cherry-pick multiple commits
- Reset local repository branch to be just like remote repository HEAD
- git – pulling from specific branch
- How to copy commits from one branch to another?
- Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
- Remove a git commit which has not been pushed
- There is no tracking information for the current branch
- Git push results in “Authentication Failed”
- What are the differences between .gitignore and .gitkeep?
- How to remove files from git staging area?
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- How to undo git reset –soft to get my changes back?
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- What’s the difference between git switch and git checkout
- What is the point of ‘git submodule init’?
- How to remove a directory from git repository?
- git submodule add error: does not have a commit checked out
- Git nothing added to commit but untracked files present – even with those files added to gitignore
- git: How to ignore all present untracked files?
- What are the differences between “git commit” and “git push”?
- What to gitignore from the .idea folder?git intellij-idea gitignore webstorm
- Is it possible to pull just one file in Git?
- How do you clone a Git repository into a specific folder?
- git checkout master error: the following untracked working tree files would be overwritten by checkout
- How can I see the changes in a Git commit?
- Completely cancel a rebase
- How to discard local changes and pull latest from GitHub repository
- Git removing upstream from local repository
- Git: What’s the best practice to “git clone” into an existing folder?
- Git pull – Please move or remove them before you can merge
- Unlink of file Failed. Should I try again?
- Resetting remote to a certain commit
- Change the location of the ~ directory in a Windows install of Git Bash
- Differences between Commit, Commit and Push, Commit and Sync
- Git checkout – switching back to HEAD
- Import existing source code to GitHub
- git checkout all the files
- Git Workflow for Large, Live Site?
- Workflow for working with git and WordPress
- Git beginner: Keeping track of on-server changes
- best practice on pushing staging development (database/uploads) to the live server
- how can I create a WP offline environment before releasing the websites? [closed]