All How-Tos
Beginner

How to Checkout a Remote Branch in Git

Learn how to checkout a remote branch that exists on a remote repository but not yet in your local working copy.

Checkout a Remote Branch

To check out a remote branch (for which no local tracking branch yet exists):

Use the git switch command where <branch> is the branch name and <remote> is the remote name (typically origin).

git switch -c <branch> <remote>/<branch>

Example

This creates a new local branch feature/new-ui tracking origin/feature/new-ui.

git switch -c feature/new-ui origin/feature/new-ui