What is a Remote

A remote is a named URL pointing to another Git repository. It lets you exchange objects and refs with that repository using git fetch, git push, and git pull.

How it works

Remotes are configured in .git/config:

[remote "origin"]
    url = [email protected]:user/repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*

The fetch line defines the mapping: remote branches are stored locally under refs/remotes/origin/. When you git fetch origin, Git downloads new objects and updates origin/main, origin/feature, etc.

You can have multiple remotes — common in fork-based workflows:

git remote add upstream [email protected]:original/repo.git
git fetch upstream

Remotes are local configuration. They do not exist on the server. Two developers cloning the same repository will both have an origin remote, but each points from their local machine to the server.

Why it matters

Remotes are how Git implements distributed version control. Every clone is a complete repository. Remotes define the connections between repositories, enabling collaboration through push and pull without a central server requirement.

See How Git Branching Works for how remote-tracking branches work.