git clone single branch

C++
git clone --single-branch --branch <branchname> <remote-repo>
# clone only the remote primary HEAD (default: origin/master)
git clone <url> --single-branch

# as in:
git clone <url> --branch <branch> --single-branch [<folder>]
git clone <repository_url>
git branch -a
git checkout <branch_name>
Source

Also in C++: