Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active April 28, 2025 01:31
Show Gist options
  • Save mcandre/fca6b04cc80d304e4945c59232b9aa1f to your computer and use it in GitHub Desktop.
Save mcandre/fca6b04cc80d304e4945c59232b9aa1f to your computer and use it in GitHub Desktop.
git checkout remote refs

git checkout remote refs

$ git fetch [--all]
$ git checkout -b <branch> --track <remote>/<ref>

Where ref is a commit, tag, or branch.

Thereafter use ordinary git checkout <branch> commands to select between local branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment