Gitflow
🛰️Track a Remote Branch LocallyEasy+300 XP
Workshop
Scenario reference

Track a Remote Branch Locally: the situation, step by step

The situation

A teammate pushed `feature/payments`. You want a local copy that pulls/pushes against theirs.

`git switch --track origin/feature/payments` creates and tracks in one go.

Easy · 2 steps · +300 XP

What you will practice

This scenario walks through 2 steps, in order:

  1. 01Fetch first
  2. 02Create tracking branch
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Fetch first
    git fetch origin
  2. 2. Create tracking branch
    git switch --track origin/feature/payments

Key takeaway

--track sets upstream automatically. No second `--set-upstream` push needed.