how to clone a repository in git and checkout a branch code example Example: clone a branch git clone --single-branch --branch <branchname> <remote-repo>