Skip to content

Commit

Permalink
Added how to rename a local branch (k88hudson#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and RichardLitt committed Nov 11, 2017
1 parent 4547f3e commit e2ddb7f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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 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)
- [Rebasing and Merging](#rebasing-and-merging)
- [I want to undo rebase/merge](#undo-rebase)
Expand Down Expand Up @@ -601,6 +602,21 @@ To delete a local branch:
(master)$ git branch -D my-branch
```

<a name="i-want-to-rename-a-branch"></a>
### I want to rename a branch

To rename a local current branch:

```sh
(master)$ git branch -m new-name
```

To rename a local different branch:

```sh
(master)$ git branch -m old-name new-name
```

<a name="i-want-to-checkout-to-a-remote-branch-that-someone-else-is-working-on"></a>
### I want to checkout to a remote branch that someone else is working on

Expand Down

0 comments on commit e2ddb7f

Please sign in to comment.