Remote Repositories

A remote is a named reference to another Git repository. origin is the conventional name assigned to the repository from which a clone was created, but it is only a name and can be changed.

Use git remote -v to inspect configured URLs and git remote add to add another remote.

Manage Remotes
git remote -v
git remote add upstream https://example.com/team/project.git
git remote set-url origin https://example.com/my/project.git
git remote remove upstream
💡 Remote names are local aliases for repository URLs. A project can have multiple remotes such as origin and upstream.
Key Takeaways
  • A remote is a local name pointing to another repository.
  • origin is conventional, not mandatory.
  • Multiple remotes can be configured.
Knowledge Check

Is `origin` a special Git keyword that must always refer to GitHub?