if you want to clone a specific branch of a Git repository, you can use the git clone command and specify the branch name with the -b parameter.
The base command to clone a Git repository is:
git clone -b <branch-name> <repository-url>
branch-name
: branch name to clone.repository-url
: URL of the git repository.
For example to clone a branch named develop
, you can use the following command:
git clone -b develop https://github.com/example/repo.git
if you want to see the list of available branches in a remote repository, you can use:
git ls-remote --heads <repository-url>