# syntax
git clone -b <branch> <remote_repo>
# Example
git clone -b my-branch git@github.com:user/myproject.git
# With Git 1.7.10 and later, add --single-branch to prevent fetching of all branches.
# Example, with OpenCV 2.4 branch:
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
git clone --single-branch --branch <branch> <repository>
git clone -b <your_branchname> <your_git-remote-repo>
git clone -b <branch> <remote_repo>
git clone -b my-branch git@github.com:user/myproject.git
git clone --single-branch --branch master https://github.com/career-karma-tutorials/ck-git
git clone <repository_url>
git branch -a
git checkout <branch_name>
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
# Using gh CLI
gh repo clone <username>/<reponame> -- -b <branchname>
git checkout <name_of_branch>