Git clone a specific branch

“git clone” clones the default branch of the remote repository as determined by the Git server. The default Git branch is typically “main”, but the repository owner can change it to any other branch. To Git clone a specific branch, use the –branch option:

git clone --branch <branch-name> <repository-url>

This can help workaround problems like a default branch that is very large or is broken in some way.