CodeBlanks Logo Icon CodeBlanks

git remote

Learn the remote list with git remote.

Listing Remote Repositories

The git remote command lists the names of remote repositories connected to your local repository. When you clone a GitHub repository or add a remote, there is usually a remote named origin.

git remote
origin

This command is sufficient to see only the names of remote repositories.

Viewing Remote Repository URLs

The git remote -v command displays both remote names and their URLs. The fetch URL is used to retrieve data, while the push URL is used to send changes.

git remote -v
origin  https://github.com/user/project.git (fetch)
origin  https://github.com/user/project.git (push)

The two URLs can be the same, but different URLs can also be configured when needed.

Practice Display Remote Names

Run git remote in a Git repository. Then enter the command that displays the remote name origin.

Starter code

terminal
# Uzak depo adını göster

Expected output

origin

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does the git remote command list?

  • All files in the repository
  • The contents of existing branches
  • The names of connected remote repositories Correct answer
  • The local commit history

Explanation: <code>git remote</code> displays only remote names. A different option is used to display remote repository URLs.

2 List Remote Repositories in Detail

Question
git remote ____
Answer
git remote -v

Explanation: The <code>-v</code> option displays remote names and URLs together.

3 Remote Listing Concepts

Term Meaning
git remote Lists remote names
git remote -v Displays URLs too
origin Common remote name
fetch Retrieves data from remote

All lessons in Intermediate

20 Intermediate final

  1. Branch management
  2. Rebase
  3. Conflict
  4. PR flow