Remote Repository

Remote Repository

The GitHub engagement approach to development is based on the commits of publishing from your local area to GitHub for other people to view, fetch, and update

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

You can only push to two types of URL addresses:

  • An HTTPS URL like
  • An SSH URL, like

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

header How to create Remote Repository

You can use the command “git remote add” to match a remote URL with a name. For example, you can type the following into the command line:

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

Adding new repository

To add a new remote repository, use the “git remote add” command, in the directory where your repository is stored. Use the command on the terminal.

The git remote add command takes two arguments:

  • A remote name, for example, origin
  • A remote URL, for example,


$ git remote add origin

# Set a new remote

$ git remote -v

# Verify new remote

> origin (fetch)

> origin (push)

Changing a remote repository's URL

The git “remote set-url”: command changes the existing URL of the remote repository.The command takes two arguments:

  • An existing remote name. For example, origin or upstream are two common choices.
  • A new URL for the remote. For example:
    • If you're updating to use HTTPS, your URL might look like:
    • If you're updating to use SSH, your URL might look like: