DEV Community

Cover image for Terminal commands to check Git remote configurations
K-kibet
K-kibet

Posted on

Terminal commands to check Git remote configurations

Here are the commands to check Git remote configurations:

Check Remote URLs

git remote -v
Enter fullscreen mode Exit fullscreen mode

This shows all remote repositories with their fetch and push URLs.

List Remote Names

git remote
Enter fullscreen mode Exit fullscreen mode

Shows just the names of your remotes (usually "origin").

Get Detailed Remote Info

git remote show origin
Enter fullscreen mode Exit fullscreen mode

Shows detailed information about a specific remote including fetch/push URLs and branch tracking.

Check Remote URL for Specific Remote

git config --get remote.origin.url
Enter fullscreen mode Exit fullscreen mode

Directly gets the URL for the "origin" remote.

Common Output Examples

$ git remote -v
origin  https://github.com/user/repo.git (fetch)
origin  https://github.com/user/repo.git (push)
Enter fullscreen mode Exit fullscreen mode

If you don't see any output, it means no remote repositories are configured. You can add one with:

git remote add origin <repository-url>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)