The Wayback Machine - https://web.archive.org/web/20200705095933/https://docs.github.com/en/github/using-git/about-remote-repositories
👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.
Article version: GitHub.com

About remote repositories

GitHub's collaborative approach to development depends on publishing commits from your local repository for other people to view, fetch, and update.

Were you able to find what you were looking for?

A remote URL is Git's fancy way of saying "the place where your code is stored." That URL could be your repository on GitHub, or another user's fork, or even on a completely different server.

You can only push to two types of URL addresses:

  • An HTTPS URL like https://github.com/user/repo.git
  • An SSH URL, like [email protected]:user/repo.git

Git associates a remote URL with a name, and your default remote is usually called origin.

For information on the differences between these URLs, see "Which remote URL should I use?"

Creating remotes

You can use the git remote add command to match a remote URL with a name. For example, you'd type the following in the command line:

git remote add origin  <REMOTE_URL> 

This associates the name origin with the REMOTE_URL.

You can use the command git remote set-url to change a remote's URL.

Were you able to find what you were looking for?

Ask a human

Can't find what you're looking for?

Contact us