Get Remote Origin URL of Local Git Repository

Get Remote Origin URL of Local Git Repository

When working with Git, it's often necessary to check the remote URL associated with a local repository. This is useful when you need to verify where the repository is hosted, update the remote, or troubleshoot connectivity issues. This tutorial explains how to get remote origin URL of local Git repository.

You can obtain the remote origin URL using the following command:

git remote get-url origin

Output example:

https://github.com/opencv/opencv.git

If you want to see all remotes associated with the local repository, including fetch and push URLs, use:

git remote -v

Output example:

origin  https://github.com/opencv/opencv.git (fetch)
origin  https://github.com/opencv/opencv.git (push)

Leave a Comment

Cancel reply

Your email address will not be published.