git clone
克隆远程仓库
语法
git clone <仓库URL> [目录名]说明
从远程服务器克隆 Git 仓库到本地。支持 HTTPS、SSH 等多种协议。
参数
--depth创建浅克隆,只包含指定深度的历史
--branch克隆指定分支
--recursive递归克隆子模块
示例
基本克隆
克隆一个仓库到当前目录
git clone https://github.com/user/repo.git指定目录
克隆到指定目录
git clone https://github.com/user/repo.git my-project浅克隆
只克隆最近一次提交
git clone --depth 1 https://github.com/user/repo.git