How do I clone a specific Git branch

preview_player
Показать описание
Git clone will clone remote branch into local.

Is there any way to clone a specific branch by myself without switching branches on the remote repository?

git clone -b branch_name remote_repo_url
Example:

With Git 1.7.10 and later, add --single-branch to prevent fetching of all branches. Example, with OpenCV 2.4 branch:

Git clone a branch, not master
How do I clone a single branch in Git?
git - Cloning specific branch
How to clone git repository with specific revision
how to clone a branch in github
git clone --branch to folder
git clone only one branch without history
git checkout specific branch
git pull specific branch from remote
git clone specific tag
git clone all branches
git clone to specific folder
Рекомендации по теме
Комментарии
Автор

It would be really helpful if you would have added your vocal while doing the steps.

ivanskinner