less than 1 minute read

If you want a specific branch of a repo, rather than running:

git clone <remote-repo>
git checkout <branchname>

you can combine these commands:

git clone --branch <branchname> <remote-repo>

If you only want a specific branch, you can use the --single-branch option:

git clone --single-branch --branch <branchname> <remote-repo>

Via SO.

Tags: ,

Categories:

Updated:

Comments