git remote Manage the other copies of your repository
Lists and edits the named links to other copies, usually on GitHub. The default link created by git clone is called origin.
Synopsis
git remote [-v]
git remote add NAME URL
git remote set-url NAME URL
Common options
| Option or form | What it does |
|---|---|
-v | Show each remote with its fetch and push addresses |
add NAME URL | Add a new remote |
remove NAME | Delete a remote |
rename OLD NEW | Rename a remote |
set-url NAME URL | Change a remote's address |
show NAME | Describe a remote and its branches |
Examples
git remote -v
origin https://github.com/ana/site.git (fetch)
origin https://github.com/ana/site.git (push)
git remote add origin [email protected]:ana/site.git
git remote add upstream https://github.com/octocat/Hello-World.git
git remote set-url origin [email protected]:ana/site.git
Notes
- The names are only labels. origin is a convention, and upstream is the usual name for the project you forked from.
- A remote holds no files itself. It is just a saved address.
- gh repo fork can add the upstream remote for you.
See also
Last reviewed 2026-10-09.