← 返回命令列表

Linux command

git-remote 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List remotes

git remote -v

Add remote

git remote add [name] [url]

Remove remote

git remote remove [name]

Rename remote

git remote rename [old] [new]

Show remote details

git remote show [origin]

说明

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.

参数

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.
prune _NAME_
Remove stale tracking branches.
get-url _NAME_
Show URL for remote.
-v, --verbose
Show URLs.
--help
Display help information.

FAQ

What is the git-remote command used for?

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.

How do I run a basic git-remote example?

Run `git remote -v` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does add _NAME_ _URL_ do in git-remote?

Add new remote.