美文网首页
git remote

git remote

作者: Muscleape | 来源:发表于2018-09-06 09:47 被阅读36次

为了便于管理,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)
  • 上面命令表示,当前只有一台远程主机,叫做origin,以及它的网址;
  • 克隆版本库的时候,所使用的远程主机自动被Git命名为origin。如果想用其他的主机名,需要用git clone命令的-o选项指定;
$ git clone -o jQuery https://github.com/jquery/jquery.git
$ git remote
jQuery
  • 上面命令表示,克隆的时候,指定远程主机叫做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 <原主机名> <新主机名>

相关文章

  • Git

    git remote git remote add memorycancel [url]git remote re...

  • https->ssh

    git remote -v git remote rm origin git remote add origin ...

  • 【Git】remote

    展示remote地址: git remote -v展示remote名称: git remote设置remote: ...

  • 出现“fatal: Authentication Failed”

    解决办法: git remote -v git remote remove origin git remote a...

  • gitlab配合 七牛cli工具 qupload 使用

    git remote remove origingit remote add origin git@git.git...

  • Git Cheat Sheet

    远端 git remote 查看远端路径git remote -v 添加远端路径git remote add re...

  • girpro之四连接远端

    git remote git remote列出所有已经添加的远端 git remote -v顺便列出他们的url ...

  • 修改远程git仓库地址

    git remote 查看所有远程仓库, git remote xxx 查看指定远程仓库地址 git remote...

  • GitHub

    git init git remote add shop 远程地址 git remote -v git remov...

  • Git

    删除远程 Git 仓库 git remote rm origin 添加远程 Git 仓库 git remote a...

网友评论

      本文标题:git remote

      本文链接:https://www.haomeiwen.com/subject/fvutgftx.html