Skip to content
Latchkey

What Is a Git Remote?

A remote is a named reference to a copy of your repository hosted elsewhere, such as on GitHub, that you push to and fetch from.

A remote is how your local Git repository talks to a shared one. It is just a name, like origin, paired with a URL. You push your commits to a remote so others and CI can see them, and you fetch from a remote to pick up everyone else's work.

What a remote is

A remote is a bookmark for another copy of the repository, identified by a short name and a URL. You can have several remotes, for example one for the canonical project and another for your own fork. Remote-tracking branches mirror the state of those copies locally.

Working with remotes

You can list, add, and inspect remotes, then push and fetch against them by name.

Inspecting and adding remotes
git remote -v
git remote add upstream https://github.com/owner/project.git
git fetch upstream

Push and fetch

Push sends your local commits to a remote; fetch downloads new commits from a remote without changing your working files; pull is fetch plus merge. These operations are how a team converges on a shared history through the remote.

Remotes in CI/CD

The remote is the source of truth a CI/CD system watches. A push to a remote branch triggers pipelines, and the CI runner clones from the remote to build the exact pushed commit. Managed runner platforms such as Latchkey check out your remote repository at the start of each job, so a fast, reliable clone keeps pipelines snappy.

Common remote tasks

  • Use origin for the repository you cloned from.
  • Add an upstream remote when working from a fork.
  • Fetch before starting work to see the latest history.
  • Push feature branches so CI and reviewers can see them.

Key takeaways

  • A remote is a named URL for another copy of your repository.
  • Push, fetch, and pull move commits between local and remote.
  • CI watches the remote and clones it to build the pushed commit.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →