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 →
git fetch origin.git switch feature/search(Git DWIMs a tracking branch when the name matches exactly one remote).- Or explicitly:
git switch -c feature/search --track origin/feature/search. - 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.
More on Remotes, Collaboration and Pull Requests
You are new to a team. How do you collaborate daily without stepping on others' toes?BeginnerYou are migrating a repo from Bitbucket to GitHub and must keep every branch and tag.IntermediateYou want to contribute a fix to an open-source project you do not have write access to.BeginnerA teammate sent a 3,000-line PR and nobody can review it properly.IntermediateA reviewer asks for changes. How do you update the PR cleanly?BeginnerYour team wants stacked PRs so that large work arrives in small reviewable steps. How do you set it up?Advanced