Add "I want to delete multiple branches" (#196)

This commit is contained in:
Gabriel Caruso 2017-12-30 15:25:11 -02:00 committed by Richard Littauer
parent 26138f0f10
commit e4e6ee08b1
1 changed files with 10 additions and 0 deletions

View File

@ -55,6 +55,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
- [I want to delete local branches that were deleted upstream](#i-want-to-delete-local-branches-that-were-deleted-upstream)
- [I accidentally deleted my branch](#i-accidentally-deleted-my-branch)
- [I want to delete a branch](#i-want-to-delete-a-branch)
- [I want to delete multiple branches](#i-want-to-delete-multiple-branches)
- [I want to rename a branch](#i-want-to-rename-a-branch)
- [I want to checkout to a remote branch that someone else is working on](#i-want-to-checkout-to-a-remote-branch-that-someone-else-is-working-on)
- [I want to create a new remote branch from current local one](#i-want-to-create-a-new-remote-branch-from-current-local-one)
@ -742,6 +743,15 @@ To delete a local branch that *has not* been merged to the current branch or an
(master)$ git branch -D my-branch
```
<a name="i-want-to-delete-multiple-branches"></a>
### I want to delete multiple branches
Say you want to delete all branches that start with `fix/`:
```sh
(master)$ git branch | grep 'fix/' | xargs git branch -d
```
<a name="i-want-to-rename-a-branch"></a>
### I want to rename a branch