Lesson 16 / 28

git remote

Name and inspect remotes such as origin, and work with several remotes like a fork and its upstream.

Add and list remotes

origin is the conventional name for the primary remote — cloning sets it up automatically.

git remote add origin https://github.com/ada/hello-world.git
git remote -v

Output:

origin  https://github.com/ada/hello-world.git (fetch)
origin  https://github.com/ada/hello-world.git (push)

More than one remote

A repo can have several remotes — common when working against a personal fork and the original project (often named upstream).