Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I retrieve the remote git address of a repo?

Tags:

git

People also ask

What is remote repository URL?

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.

What is the command to retrieve a remote repository?

The git fetch command is used to download the contents from a remote repository. Developers use the git fetch command and the git checkout command to work with code on a different branch. The git fetch command is similar to git pull. git pull directly changes your local working copy of a repository.


When you want to show an URL of remote branches, try:

git remote -v

If you have the name of the remote, you will be able with git 2.7 (Q4 2015), to use the new git remote get-url command:

git remote get-url origin

(nice pendant of git remote set-url origin <newurl>)

See commit 96f78d3 (16 Sep 2015) by Ben Boeckel (mathstuf).
(Merged by Junio C Hamano -- gitster -- in commit e437cbd, 05 Oct 2015)

remote: add get-url subcommand

Expanding insteadOf is a part of ls-remote --url and there is no way to expand pushInsteadOf as well.
Add a get-url subcommand to be able to query both as well as a way to get all configured urls.