When working on a project, sometimes you might forget the URL of your repo. This can happen if you are juggling several projects either with the same service (e.g. GitHub) or spread across different services (e.g. Bitbucket, Gitlab). In this post, I will show three commands that you can use in order to find out very easily what is the URL of your project’s git repo.

  1. git remote show origin - Outputs the remote origin (Fetch URL, Push URL, Head branch), remote branches, local branches (pull), and local refs (push).

  2. git remote -v - Outputs both the fetch and push URLs for your project’s git repo.

  3. git config --get remote.origin.url - Outputs the remote origin URL from your git config.