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
List the connected remote repositories with their addresses
git remote -vsame as:
git remote --verboseremote— remote repositories-v— with addresses
Connect a remote repository under the name origin
git remote add origin https://github.com/owner/shop.gitremote add— add a remote repositoryorigin— its namehttps://github.com/owner/shop.git— address