How to Checkout a Remote Branch in Git

Checkout a Remote Branch

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

With SmartGit

Double-click the remote branch in the Branches or Graph view.

In the Standard Window, the local branch automatically adopts the same name as the remote branch (e.g., origin/foo becomes foo).

In the Working Tree or Log Window, a dialog appears allowing you to specify the local branch name and whether tracking should be enabled.

Try these Git operations with SmartGit's intuitive interface

Download SmartGit
Illustration of Smart Gitty, the SmartGit mascot -- a grey cartoon cat with glasses, sitting behind a laptop