clone master branch only code example
Example 1: git clone specific branch only
git clone -b mybranch --single-branch git://sub.domain.com/repo.git
Example 2: how to git clone a specific branch
# Using gh CLI
gh repo clone <username>/<reponame> -- -b <branchname>