git clone <版本库的网址> <本地目录名>
git clone支持多种协议,除了HTTP(s)以外,还支持SSH、Git、本地文件协议等,下面是一些例子。
$ 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 remote
git remote -v //查看远程主机的网址
git remote show <主机名> //查看该主机的详细信息
git remote add <主机名> <网址> //添加远程主机
git remote rm <主机名> //删除远程主机
git remote rename <原主机名> <新主机名> //重命名远程主机