git clone -b <branch> <remote_repo>
Example:
(例:)
git clone -b my-branch [email protected]:user/myproject.git
With Git 1.7.10 and later, add --single-branch
to prevent fetching of all branches.
(使用Git 1.7.10及更高版本,添加--single-branch
以防止获取所有分支。)
Example, with OpenCV 2.4 branch: (例如,使用OpenCV 2.4分支:)
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…