skip to content

Remotes and Collaboration

You will learn what a remote-tracking ref is, how fetch, pull and push actually update it, and why pull --rebase produces different history than plain pull. This is where interviewers probe your understanding of the fork-and-pull-request model most teams work in.

part ofGitoverview, primer and where to startread it →
on this pageshow

questions

page 2 of 2

How would you maintain a long-lived fork carrying local patches on top of an actively developed upstream project?

level: principalimportance: should knowfreq 30%

basics

~20 s

Keep local changes as a small, curated commit series on a branch above an untouched mirror of upstream, refresh it by rebasing onto each new upstream release, measure the recurring conflict cost, and continuously shrink the delta by getting patches accepted upstream.

open as a page

How do you decide between SSH keys and HTTPS tokens for Git access across many CI jobs and machines?

level: principalimportance: should knowfreq 33%

basics

~20 s

Judge each option on lifetime, scope, how the secret reaches the git process, and what happens when a machine is compromised. Tokens favour short-lived, narrowly scoped, easily rotated automation; keys favour stable identities where port 443 is unavailable or an agent already exists.

open as a page

In Git, what does branch.autoSetupMerge control when you create a new branch?

level: middleimportance: nice to knowfreq 28%

basics

~20 s

branch.autoSetupMerge decides whether a newly created branch automatically gets upstream configuration. At its default value true, Git sets the upstream only when the new branch starts from a remote-tracking branch; false never does, always does it for local start points too.

open as a page

What is Git's wire protocol v2, and what does it change about fetching?

level: middleimportance: nice to knowfreq 24%

basics

~20 s

Protocol v2 is Git's second-generation transfer protocol. Instead of the server advertising every ref up front, the client requests only the refs it cares about via ls-refs with ref prefixes, which makes fetches on ref-heavy repositories dramatically cheaper.

open as a page

In Git, why does pushing to a non-bare repository's checked-out branch fail by default?

level: seniorimportance: nice to knowfreq 22%

basics

~20 s

Because receive.denyCurrentBranch defaults to refuse: moving the branch that a working tree has checked out would leave that tree and index disagreeing with HEAD, so the receiving repository rejects the update. Shared remotes should be bare.

open as a page

showing 31–35 of 35