mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-10-31 08:17:59 +01:00
96289e570d
- changed token syntax to match project guidelines - added tokens to the rename example - moved rename example to before the delete example - reword some descriptions for clarity - include "git" in the command description
23 lines
456 B
Markdown
23 lines
456 B
Markdown
# git branch
|
|
|
|
> Main git command for working with branches.
|
|
|
|
- List local branches. The current branch is highlighted by `*`:
|
|
|
|
`git branch`
|
|
|
|
- List all branches (local and remote):
|
|
|
|
`git branch -a`
|
|
|
|
- Create new branch based on the current commit:
|
|
|
|
`git branch {{branch_name}}`
|
|
|
|
- Rename a branch (must not have it checked out to do this):
|
|
|
|
`git branch -m {{old_branch_name}} {{new_branch_name}}`
|
|
|
|
- Delete a local branch:
|
|
|
|
`git branch -d {{branch_name}}`
|