We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

What Does git remote -v Do?

ThePrimeagen
ThePrimeagenEx-Netflix engineer, NeoVim ricer, and Git rebaser

Last published

Table of Contents

The git remote -v command lists the remote repositories connected to your local Git repository. The -v means "verbose": it includes each remote's URL and shows whether Git uses it for fetching or pushing.

For course material on configuring remotes and fetching their commits, see the "Remote" chapter of Learn Git.

What Does git remote -v Do?

Run git remote -v inside a Git repository:

git remote -v

You might see:

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

origin is the remote's name. The URL tells Git where the other repository lives. The (fetch) and (push) labels show which URL Git uses to download and upload data.

Why Does Each Remote Appear Twice?

Git can use different URLs for fetching and pushing, so the verbose output prints both. Most repositories use the same URL in both directions, which is why the two lines often look identical.

Without -v, git remote prints only the names:

origin

Use the verbose form when you're checking whether origin points to the right repository or whether you're using HTTPS or SSH.

git remote -v reads this information from your local Git configuration; it doesn't contact the remote repository. To learn how origin is configured and how git fetch downloads commits and refs, read Git Remote.

Frequently Asked Questions

What does git remote -v do?

It lists each configured remote with the URLs Git uses to fetch and push.

What does -v mean in git remote -v?

It means verbose. The normal command prints remote names, while -v also prints their URLs and fetch or push purpose.

Why does origin appear twice in git remote -v?

Git prints one line for the fetch URL and one for the push URL. They are often the same but can be configured differently.

What is the difference between git remote and git remote -v?

git remote prints remote names. git remote -v also prints the fetch and push URLs for each remote.

Related Articles