Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
The safe way: [1] git branch --delete <branch-name> It will fail if the branch isn't merged. If this is ok then you can delete it anyway like this: [2] git branch --delete --force <br...
Answer
#1: Initial revision
The safe way: [[1]](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---delete) ```bash git branch --delete <branch-name> ``` It will fail if the branch isn't merged. If this is ok then you can delete it anyway like this: [[2]](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---force) ```bash git branch --delete --force <branch-name> ``` Or using the shorthand: [[3]](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--D) ```bash git branch -D <branch-name> ```