clone a particular branch

C++
git clone --single-branch --branch <branchname> <remote-repo>
git clone -b <branch> <remote_repo>git clone --single-branch --branch <branch> <repository>

Source

Also in C++: