01 / 03

What is a remote in Git?

A remote is a shared Git repository hosted on a server (e.g., GitHub, GitLab).

javascript
Difficulty: 3/10
Topics: remotes, fetch/push, collaboration

Scenario Questions

0-2 years experience
  1. 1

    You need to clone a repository and start working on a new feature. How would you add a new remote called 'upstream' that points to the original repo, and why would you do that?

  2. 2

    If you run git push without specifying a remote, what happens? Explain how Git decides where to push.

2-5 years experience
  1. 1

    Your feature branch is behind the main branch on the central repo. Walk me through how you would bring in the latest changes using remotes, and what could go wrong.

  2. 2

    A teammate reports that git fetch origin didn't bring in a new branch they pushed. What steps would you take to troubleshoot the remote configuration?

5-8 years experience
  1. 1

    Our CI system clones the repo and adds multiple remotes for staging and production environments. What are the trade‑offs of using many remotes versus a single remote with different branches, especially regarding security and performance?

  2. 2

    We need to migrate from a legacy SVN server to a Git remote while preserving history. How would you set up the new remote and ensure developers can continue pushing without disruption?

8+ years experience
  1. 1

    Our organization has dozens of micro‑service repos, each with its own remote, and we want a unified access control layer. How would you design a remote management strategy that scales, supports audit, and minimizes accidental pushes to the wrong remote?

  2. 2

    We plan to deprecate an old remote that many teams still reference in their scripts. Describe a migration plan that includes communication, tooling, and fallback mechanisms to avoid breaking builds.

Follow-up Questions

  • What’s the difference between `git fetch` and `git pull` when working with a remote?
  • If the remote URL changes, how would you update it for all developers?
  • How do you verify that a remote is correctly configured after adding it?