git clone

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

项目文件名

通过clone命令会在本地主机生成一个目录,与远程主机的版本库同名。如果要指定不同的目录名,可以将目录名作为git clone命令的第二个参数。

$ git clone <版本库的网址> <本地目录名>

协议

git clone支持多种协议,除了HTTP(s)以外,还支持SSH、Git、本地文件协议等

Git协议下载速度最快,SSH协议用于需要用户认证的场合

$ git clone http[s]://example.com/path/to/repo.git/
$ git clone ssh://example.com/path/to/repo.git/
$ git clone git://example.com/path/to/repo.git/
$ git clone /opt/git/project.git 
$ git clone file:///opt/git/project.git
$ git clone ftp[s]://example.com/path/to/repo.git/
$ git clone rsync://example.com/path/to/repo.git/

SSH协议还有另一种写法。

$ git clone [user@]example.com:path/to/repo.git/

其他命令选项

git clone -o

指定远程主机的主机名

$ git clone -o jQuery https://github.com/jquery/jquery.git
$ git remote
jQuery

相关文章

  • Git Bash使用随记

    clone 代码 git clone git@xxxxxx默认master分支 clone 指定分支代码 git ...

  • git基础操作

    基本: 从master分支clone git clone地址 从指定分支clone git clone -b 远程...

  • Git常用命令(二)

    1、git clone 功能:克隆git仓。 格式:git clone url 用法: clone完成后,已经存在...

  • Git常用命令

    git clonegit clone git clone ssh://git@xxx.xxx.git克隆远程到本地...

  • gitlab

    git clone 不指定分支 git clone 指定分支

  • git 常用命令

    1、clone项目 git clone 仓库地址 直接clone指定分支git clone -b 分支名 仓库地址...

  • EOS开发环境搭建 EOS笔记

    git clone 首先选择好想要存放的目录,然后使用如下git命令clone项目。 $ git clone ht...

  • git远程操作

    git clone 基本命令git clone <远程版本库> <本地目录名> git clone支持多种协议,除...

  • git常用命令

    git init: git初始化,并生成.git文件; git clone : 克隆项目例: git clone...

  • 关于Git命令

    1:克隆项目git clone XXXX(项目地址)例子: git clone git://git.kernel....

网友评论

      本文标题:git clone

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