Skip to content

Instantly share code, notes, and snippets.

@rashid327
Last active August 28, 2020 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rashid327/a52f9972bf8772fa19eec5a41f2bd38c to your computer and use it in GitHub Desktop.
Save rashid327/a52f9972bf8772fa19eec5a41f2bd38c to your computer and use it in GitHub Desktop.
git checkout
Usage:
# Checkout an existing branch
$ git checkout <branch_name>
# Checkout and create a new branch with that name
$ git checkout -b <new_branch>
In Practice:
# Switching to branch 'new_feature'
$ git checkout new_feature
Switched to branch 'new_feature'
# Creating and switching to branch 'staging'
$ git checkout -b staging
Switched to a new branch 'staging'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment