git remote

List and add remote repositories

What it does

A remote is a copy of the project on a server, such as GitHub. Each has a short name; the main one is usually origin. git remote -v lists your remotes with their addresses, for downloading (fetch) and uploading (push).

git remote add adds a new one: that is how you connect a project made with git init to an empty repository on GitHub. Change an address later with git remote set-url, and drop a remote with git remote remove.

Syntax

git remote -v
git remote add <name> <address>
git remote set-url <name> <address>
git remote remove <name>

Examples

Related commands

Practise · All commands