Skip to content
Latchkey

What Is the Origin Remote?

Origin is simply the default name Git gives to the remote repository you cloned from, the place you usually push to and fetch from.

When you clone a repository, Git automatically creates a remote called origin pointing at the URL you cloned. There is nothing special about the name; it is a convention. Understanding that origin is just a default helps demystify the push and pull commands you run every day.

Where origin comes from

Running git clone sets up a remote named origin pointing at the source URL, and creates remote-tracking branches under it. From then on, commands like git push and git pull default to origin when you do not name a remote explicitly.

Origin in everyday commands

Most of the time you push and pull against origin without naming it, but you can be explicit.

Cloning sets up origin
git clone https://github.com/owner/project.git
git push origin main
git pull origin main

Origin versus upstream

In a fork workflow, origin usually points at your fork while a second remote named upstream points at the original project. You push to origin and pull new changes from upstream. The names are convention, but following them keeps a team's mental model consistent.

Origin and CI/CD

CI systems clone the canonical repository, which becomes their origin, and build the commit you pushed there. When a workflow checks out code, it is fetching from this origin. Knowing which remote is origin helps when debugging why a pipeline built an unexpected commit or branch.

Tips for managing origin

  • Origin is a default name, not a magic keyword; you can rename it.
  • In forks, point origin at your fork and upstream at the source.
  • Check git remote -v when a push or pull goes somewhere unexpected.
  • CI uses its own clone as origin, independent of your local setup.

Key takeaways

  • Origin is the default name for the remote you cloned from.
  • Push and pull default to origin unless you name another remote.
  • In forks, origin is your fork and upstream is the original project.

Related guides

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