Interview Prep/Git & GitHub/Remotes, Collaboration and Pull Requests

A colleague pushed `feature/search` and you want to work on it.

BeginnerScenarioRemotes, Collaboration and Pull Requests
Answer

Situation read → You only have a remote-tracking ref until you create a local branch.

What I'd do →

  1. git fetch origin.
  2. git switch feature/search (Git DWIMs a tracking branch when the name matches exactly one remote).
  3. Or explicitly: git switch -c feature/search --track origin/feature/search.
  4. Confirm with git branch -vv.

Why → A tracking branch lets git pull and git push know their default target.

Interview tip → Talk to your colleague before pushing to their branch.

All Git & GitHub questions Roadmap: Git & GitHub

More on Remotes, Collaboration and Pull Requests