Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 555 Bytes

checkout.md

File metadata and controls

19 lines (10 loc) · 555 Bytes

All commands with "checkout"

Switch to a newly created branch

Use a different or a newly created branch.

git checkout [branch_name]

Create a branch and switch to it immediately

In a single command, you can create and switch to a new branch right away.

git checkout -b [branch_name]

Create and switch based on existing branch

The git checkout -b bases the new_branch off the current HEAD. In the given example, existing_branch will base new_branch off instead of the current HEAD.

git checkout -b [new_branch] [existing_branch]