Site Tools


wiki:git-remotes

Table of Contents

Git Remotes

Remotes are copies of your repository on another server, usually GitHub or GitLab. Push your commits to the remote so teammates can pull them. The default remote is called origin, created automatically when you clone.

$ git remote -v              # list remotes and their URLs
$ git remote add <name> <url> # add a new remote
$ git remote remove <name>   # remove a remote
$ git branch -r              # list remote branches

A remote is just a URL pointing to another repository. You can have multiple remotes (e.g., origin for GitHub, upstream for the official repo if you've forked it). Remotes are “read-only” locally—you pull from them and push to them, but you can't directly modify branches on the remote from your working directory.

wiki/git-remotes.md · Last modified: (external edit)