December 2008
Intermediate to advanced
184 pages
4h 47m
English
Branch names serve as a reminder as to what you’re working with. Sometimes those reminders need to change. Sometimes you need to fix a typo.
Let’s take our contact branch. There was
one method of contact when it started, but now there’s three.
Let’s rename it to contacts:
|
prompt> git branch -m contact contacts |
|
|
prompt> git branch |
|
|
about |
|
|
alternate |
|
|
contacts |
|
|
* master |
|
|
new |
The -m
parameter will not overwrite an existing branch, so the
new branch—the second branch name you provide—must be unique.
Git complains like this if you try to rename a branch using an
existing name:
|
prompt> git branch -m master contacts |
|