How to show the full URL of a Git repository using git command

I pulled a project with from GitHub a long ago. Right now I do not know the full url of the Git repository. I want to look at the full git repository but I guess it will be confusing since there are many similarly  named repositories under my Github account.

So how do I determine which Github Repository I cloned from using command line??

Here is the simple answer!

The minimal information – the URL

The command:

git config --get remote.origin.url

or

git remote get-url origin

It output the response, something like:

https://github.com/inimist/repo_laravel.git

The detailed info – Everything you need to know!

There is another command which outputs a detailed description of the repository. It is:

git remote show origin

It shows something like:

* remote origin
  Fetch URL: https://github.com/inimist/repo_laravel.git
  Push  URL: https://github.com/inimist/repo_laravel.git
  HEAD branch: master
  Remote branches:
    dev                                                tracked
    charan                                             new (next fetch will store in remotes/origin)
    dev2                                               tracked
    master                                             tracked
    refs/remotes/origin/dev                            stale (use 'git remote prune' to remove)
    refs/remotes/origin/dev2                           stale (use 'git remote prune' to remove)
  Local ref configured for 'git push':
    charan pushes to charan (up to date)

Ref. url at Github

Leave a Reply