List all remotes in a git repository

April 24, 2021  ‐ 1 min read

You may have multiple git remotes configured for you repository. Like me in my forked Django repository on GitHub, where I have set the original Django repository as a second remote. You can easily list git remotes on the command line with the git remote command. This command just shows the local names of the remote repositories. As you can see in the following example:

$ git remote
origin
upstream

You can get more information out of the command. By adding -v you get information about the remote urls as well, -v being short for --verbose. The following lists git remotes with urls:

$ git remote -v
origin  git@github.com:koenwoortman/django.git (fetch)
origin  git@github.com:koenwoortman/django.git (push)
upstream        git@github.com:django/django.git (fetch)
upstream        git@github.com:django/django.git (push)