-3

I created a sub-branch using git checkout -b mysubbranch command. How do I delete this sub-branch?

lagbox
  • 48,571
  • 8
  • 72
  • 83

1 Answers1

0

Try this:

git branch -D mysubbranch

Adrian Edy Pratama
  • 3,841
  • 2
  • 9
  • 24
  • @TomFreudenberg Do you have a source for that. As far as I know `branch -D` will delete the branch even if it wasn't merged, while `branch -d` only allows deletion if it was merged. It will not cause deletion of the remote branch. – Mark Rotteveel Aug 23 '20 at 09:35
  • 2
    @MarkRotteveel I was completeley wrong, thanks for asking again! Just as a more detail answer I link to this SO question https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely – Tom Freudenberg Aug 24 '20 at 11:56