How to add a remote to an existing repository?

git remote add remote_name URL

To add a new remote to an existing repository use git remote add remote_name URL.

Layer 1
Terminal Example
git remote add origin git@github.com:githint/new-repo.git

git remote -v
origin  git@github.com:githint/new-repo.git (fetch)
origin  git@github.com:githint/new-repo.git (push)

See git remote to learn more about it.

Last modified on November 30, 2021.

You might also like