# 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>
clone a specific branch...
$ git clone -b <branchName> <clone with HTTPs link>
git clone -b <branch> <remote_repo>
git clone -b my-branch git@github.com:user/myproject.git
clone specefic branch in git
git clone --single-branch --branch <branchname> <remote-repo>
clone specefic branch in git
git clone --single-branch --branch <branchname> <remote-repo>
git clone <repository_url>
git branch -a
git checkout <branch_name>
git clone -b <branch name> --single-branch https://github.com/<user name>/<repo>.git
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
# Using gh CLI
gh repo clone <username>/<reponame> -- -b <branchname>