Glossary

Git Remote

A remote in git is a named reference to another repository, typically hosted on a server like GitHub, GitLab, or a self-hosted gitea. Remotes let you push your local commits to a shared location and pull others' commits from it. Every clone starts with one remote called origin, which points to the repository it was cloned from.

git remote -v                            # list remotes with URLs
git remote add upstream https://...      # add a second remote
git fetch origin                          # download new commits
git push origin main                      # push main branch
git pull origin main                      # fetch + merge
git remote remove old
git remote set-url origin git@...         # change URL

When collaborating via a fork, it is common to have two remotes: origin (your fork) and upstream (the original repository). You push work to origin and pull updates from upstream. This pattern is the foundation of most open-source contribution workflows.

Remote-tracking branches like origin/main are local references that track the state of the remote the last time you fetched from it. They are updated by git fetch and consulted (but not changed) by git push. Understanding the difference between local branches, remote-tracking branches, and actual remote branches is essential for advanced git use.

Related terms: Git, push, pull, fetch, clone

Discussed in:

Also defined in: Textbook of Linux