CurriculumRemote RepositoriesWhat are Remotes?
Lesson 1 of 714%
Intermediate5 min+50 XP

What are Remotes?

A remote is a version of your repository hosted on a server — typically GitHub, GitLab, or Bitbucket. Remotes enable collaboration by giving every team member a shared place to synchronize their work.

01.How Remotes Work

Your local repo can connect to multiple remotes. The default remote is named "origin" by convention. When you clone a repo, origin is configured automatically pointing back to the source. You push to share your commits, and fetch/pull to receive others' commits.

Distributed Architecture
💻
Your Local
push / pull
☁️
GitHub (Remote)
push / pull
💻
Teammate's Local

02.Remote-Tracking Branches

Git maintains remote-tracking branches like origin/main — these are local read-only references that mirror the state of the remote as of your last fetch. They let you compare your local work against the remote without needing an active connection.

Branch Visualization
featuremainHEAD
main
feature
HEAD

Commands

commands — click to reveal output
$
git remote
List all configured remotes
▼ show output
$
git remote -v
List remotes with their URLs
▼ show output
$
git remote add origin https://github.com/user/repo.git
Connect your local repo to a remote
$
git remote remove origin
Remove a remote connection
$
git remote rename origin upstream
Rename a remote
$
git remote show origin
Detailed info about a remote
▼ show output
KNOWLEDGE CHECK

What is "origin" in Git?

Rate this lesson:
PreviousNext Lesson