Git remote examples: Interacting with Github and other External Repos

Last updated:
Table of Contents

Add new remote

Add a remote called origin

$ git remote add origin <URL>;

Delete remote

Delete remote called origin

$ git remote remove origin

Change origin of git repository

Say you have a git repository that points to a remote repo (origin) and you want to change it.

$ git remote rm origin
$ git remote add origin git@github.com:username/project.git
$ git config master.remote origin
$ git config master.merge refs/heads/master

See all remotes for repository

$ git remote -v

Dialogue & Discussion