Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git remote

Manage remote repository connections

Syntax

git remote [options] <command>

Common Options

OptionDescription
-v, --verboseShow verbose remote URLs
add <name> <url>Add remote repository
remove <name>Remove remote repository
set-url <name> <url>Change remote URL
get-url <name>Get remote URL
show <name>Show remote details
set-branches <name> <branch>Set remote tracking branches
prune <name>Prune deleted remote branches
rename <old> <new>Rename remote

Examples

git remote -v

List all remote URLs

git remote add origin https://github.com/user/repo.git

Add remote repository

git remote set-url origin git@github.com:user/repo.git

Change remote URL to SSH

git remote show origin

Show remote details

Related Tools

More Code & Dev Tools