What is a remote in Git?

Why Interviewers Ask This

This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Git & GitHub topics. It also reveals how well you can explain technical ideas to non-experts.

Answer

A remote in Git is a named reference to another Git repository, typically hosted on a server (GitHub, GitLab, etc.). Remotes allow you to push your changes to and pull changes from shared repositories. The default remote name when you clone is origin. Commands: git remote — list remote names; git remote -v — list remotes with their URLs (fetch and push URLs); git remote add upstream https://github.com/original/repo.git — add a second remote called "upstream" (common when you fork a repo and want to pull from the original); git remote remove upstream — remove a remote; git remote rename origin oldname — rename; git remote set-url origin https://new-url.git — change the URL (useful when migrating from HTTPS to SSH or changing hosts); git remote show origin — detailed info including tracked branches. Multiple remotes: a repo can have multiple remotes — "origin" (your fork), "upstream" (original repo), "production" (deployment server). Remote tracking branches (like origin/main) are local references to the last known state of remote branches — updated by git fetch.

Pro Tip

Back up your answer with a specific project or situation. Saying 'In my last Git & GitHub project, I used this when...' immediately makes your answer more credible and memorable.