git remote
Manage remote repository connections: add, remove, rename, and view remotes
Syntax
git remote [<subcommand>] [<options>]
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
-v |
URL | |
Common |
add <name> <url> |
New | |
Common |
remove <name> |
|
Common | |
rename <old> <new> |
|
Common | |
set-url <name> <url> |
URL | |
Common |
Examples
URL
git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
(fork Common)
git remote add upstream https://github.com/original/repo.git
git remote remove origin
URL HTTPS SSH
git remote set-url origin git@github.com:user/repo.git
git remote show origin
Tips
- fork upstream New
- HTTPS SSH
- git remote prune origin