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

后端 未结 3 1830
不思量自难忘°
不思量自难忘° 2020-12-24 04:33

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

I tried git remote but that just lists the branches.

3条回答
  •  春和景丽
    2020-12-24 04:55

    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 )

    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.

提交回复
热议问题