duplicate clone remote branch locally git

C++
git checkout -b <new_local_branch_name> <remote>/<remote_branch_name>
// example
git checkout -b my_branch origin/my_branch
Source

Also in C++: