0

Can I remove branches using the commands below?

Local branch:

git branch -d <branchName>

Remote branch:

git push origin --delete <branchName>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Daniel
  • 567
  • 6
  • 20
  • possible duplicate of [How to delete a Git branch both locally and remotely?](http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely) – Nic Wortel Jul 02 '14 at 13:59

1 Answers1

5

Yes.

One thing you should be aware of is that -d is a "safe" delete: it'll only let you delete a branch that's merged in to your current HEAD. If you want to delete any branch, use -D:

git branch -D <branchName>
Ash Wilson
  • 22,820
  • 3
  • 34
  • 45