A new developer joins. What Git setup do you walk them through on day one?
BeginnerScenarioRemotes, Collaboration and Pull Requests
Answer
Situation read → Good defaults prevent a pile of avoidable mistakes.
What I'd do →
- Identity:
git config --global user.nameanduser.emailmatching their GitHub account. - Auth: SSH key or
gh auth login; add the key to GitHub. - Sane defaults:
init.defaultBranch main,pull.rebase true,fetch.prune true,rerere.enabled true. - Commit signing, editor, and the team's PR template and branching rules.
- Clone and run the repo's bootstrap script (hooks installed by
pre-commit installor similar).
Why → Identical defaults across the team means fewer "works on my machine" Git problems.
Interview tip → Keep this in an onboarding doc in the repo, not in people's heads.
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