git remote

2018-09-06  本文已影响36人  Muscleape

为了便于管理,Git要求每个远程主机都必须指定一个主机名。git remote命令就用于管理主机名。

常用命令

git remote

不带选项,列出所有远程主机

$ git remote
origin

git remote -v

使用-v选项,可以查看远程主机的网址;

$ git remote -v
origin  git@github.com:jquery/jquery.git (fetch)
origin  git@github.com:jquery/jquery.git (push)
$ git clone -o jQuery https://github.com/jquery/jquery.git
$ git remote
jQuery

git remote show

查看主机的详细信息;

$ git remote show <主机名>

git remote add

添加远程主机

$ git remote add <主机名> <网址>

git remote rm

删除远程主机

$ git remote rm <主机名>

git remote rename

远程主机改名

$ git remote rename <原主机名> <新主机名>
上一篇 下一篇

猜你喜欢

热点阅读