How To Get Remote Url On Git

at in tips

A remote is a common repository used by a team to exchange their work.

And a project can occasionally have more than one remote, to check where a remote is located you can fetch the remote’s URL by issuing:

git remote get-url --all remote-name

There are a couple of things worth noting in this command:

  • –all: Flag which tells the command to return all URLs related to the remote, on Git sometimes you can have a URL to fetch and other to pull, but the norm is to use the same for both actions.
  • remote-name: Usually, this parameter will be origin which is the default name for the remote repository, but if your project has more than one remote you can check using:
git remote

See Also