remote remove
- Git course
- Intermediate
- Lesson 27/82
- 4 min
Learn to remove a remote with git remote remove.
Removing a Remote Connection
The git remote remove command removes a remote repository connection registered in your local repository. You write the name of the remote you want to remove after the command.
git remote remove backupThis operation removes only the local connection record; it does not delete the remote repository or its files on GitHub.
Cleaning Up Connections
Removing an unused remote connection helps keep your repository's connection list organized. Before removing one, you can check the existing names and URLs with git remote -v.
git remote -v
git remote remove backup
git remoteThe final command displays the remote names that remain after removal.
Practice Remove a Remote Connection
Remove the remote connection named old-server from the local repository. Then list the remaining remote names. Assume that only origin and old-server connections existed initially.
Starter code
# Eski bağlantıyı kaldır
# Kalan bağlantıları listeleSample solution
git remote remove old-server
git remoteExpected output
origin
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What is the result of git remote remove backup?
- The backup repository on GitHub is deleted.
- The local repository is completely deleted.
- The backup connection is removed from the local repository. Correct answer
- The backup branch is merged.
Explanation: This command does not delete the repository on the remote server. It only removes the connection from the local Git configuration.
2 Remove the Backup Connection
git remote ____ backup
git remote remove backup
Explanation: The <code>remove</code> subcommand removes the specified remote connection from the local repository.
3 Remote Connection Cleanup
| Term | Meaning |
|---|---|
git remote remove |
Removes a connection |
backup |
Remote name to remove |
git remote |
Shows remaining names |
git remote -v |
Checks names and URLs |