git remote Manage the other copies of your repository

Lists and edits the named links to other copies, usually on GitHub. The default link created by git clone is called origin.

Synopsis

git remote [-v]
git remote add NAME URL
git remote set-url NAME URL

Common options

Option or formWhat it does
-vShow each remote with its fetch and push addresses
add NAME URLAdd a new remote
remove NAMEDelete a remote
rename OLD NEWRename a remote
set-url NAME URLChange a remote's address
show NAMEDescribe a remote and its branches

Examples

See where you push and pull
git remote -v
origin	https://github.com/ana/site.git (fetch)
origin	https://github.com/ana/site.git (push)
Link a local repository to GitHub
git remote add origin [email protected]:ana/site.git
Add the original project after forking
git remote add upstream https://github.com/octocat/Hello-World.git
Switch from https to ssh
git remote set-url origin [email protected]:ana/site.git

Notes

See also

Last reviewed 2026-10-09.