Answers for "how to clone a branch other than main"

47

clone specific branch

git clone --single-branch --branch <branchname> <remote-repo>
Posted by: Guest on April-02-2020
8

clone specific branch

In general:

git clone -b <branch> <remote_repo>

Example:

git clone -b develop [email protected]:user/myproject.git
Posted by: Guest on August-03-2020
12

clone from a specific branch

git clone -b <branchName> <remote_repo_url>
Posted by: Guest on November-09-2020
1

git clone specific branch only

git clone -b mybranch --single-branch git://sub.domain.com/repo.git
Posted by: Guest on December-14-2020
1

clone a specific branch

clone a specific branch... 
$ git clone -b <branchName> <clone with HTTPs link>
Posted by: Guest on June-30-2021
0

how to git clone a specific branch

# Using gh CLI

gh repo clone <username>/<reponame> -- -b <branchname>
Posted by: Guest on April-17-2021

Code answers related to "how to clone a branch other than main"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language