remote
A short name saved in a repository's config that stands for another repository's location, a URL or a path, so you can fetch from and push to it.
In more detail
git remote add origin followed by a URL stores the name and location in .git/config, and git remote -v lists them. A remote is configuration, not a copy: it often points at a hosting service such as GitHub, but a repository in the folder next door works just as well. git push sends commits to a remote and git fetch brings its commits back, and a repository can have any number of remotes.
Examples
git remote set-url hub ../mirror.gitgit config remote.origin.urlRelated terms
- origin remote — The default name git clone gives the remote you cloned from; a convention, not a special keyword.
- remote-tracking branch — A local, read-only record of where a branch on a remote pointed the last time you talked to it, such as origin/main.
- git fetch — The command that downloads new commits and refs from a remote and updates your remote-tracking branches, without changing your own branches or files.
- git push — The command that uploads your commits to a remote and moves the remote's branch to match.
- bare repository — A repository that is only the Git database, with no working tree, used as a shared place to push to and fetch from.
- URL — A web address, such as https://example.com/docs, made of a scheme, a host, an optional port and a path.
- GitHub — A hosting service for Git repositories that adds collaboration features such as pull requests, issues, forks and releases.
- repository — A project folder whose full history is tracked by version control; in Git, your files plus the hidden .git directory that stores every commit.
- Git — A free, open-source distributed version control system that records the history of a project as a chain of snapshots.
Taught in
- What A Remote Actually Is — Advanced Git Internals & Distributed Workflows
- Clone, Forks, Push, And The Upstream Branch — Advanced Git Internals & Distributed Workflows
- Fetch Is Not Pull — Advanced Git Internals & Distributed Workflows
- The Pull Request, And Branch Naming — Advanced Git Internals & Distributed Workflows
- Amend, And The One Hard Rule — Advanced Git Internals & Distributed Workflows
- Tags And Releases — Advanced Git Internals & Distributed Workflows
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book