LinuxCommandLibrary

git-remote

Manage remote repository connections

TLDR

List remotes

$ git remote -v
copy
Add remote
$ git remote add [name] [url]
copy
Remove remote
$ git remote remove [name]
copy
Rename remote
$ git remote rename [old] [new]
copy
Show remote details
$ git remote show [origin]
copy

SYNOPSIS

git remote [command] [options]

DESCRIPTION

git remote manages tracked remote repositories. It configures URLs and refspecs for fetch and push operations, enabling interaction with multiple remote repositories in distributed workflows.
Common operations include adding upstream remotes for fork-based development, changing URLs after repository migrations, renaming remotes, and inspecting remote configuration details like tracked branches and push/fetch URLs.

PARAMETERS

add NAME URL

Add new remote.
remove NAME
Remove remote.
rename OLD NEW
Rename remote.
show NAME
Show remote info.
set-url NAME URL
Change remote URL.
-v, --verbose
Show URLs.
--help
Display help information.

CONFIGURATION

.git/config

Repository remote configuration with URLs and refspecs.
$ [remote "origin"]
    url = https://github.com/user/repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
copy

CAVEATS

Remote names are local aliases. URLs can differ for fetch and push. Removing remote keeps fetched objects.

HISTORY

git remote is a core Git command for managing the remote repository connections essential to distributed version control.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community