Answers for "how to clone a code for specific branch in git"

58

clone specific branch

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

clone a given branch github

git clone --single-branch --branch <branch> <repository>
Posted by: Guest on April-28-2020
3

How do I clone a specific Git branch?

# syntax
git clone -b <branch> <remote_repo>

# Example
git clone -b my-branch [email protected]:user/myproject.git

# With Git 1.7.10 and later, add --single-branch to prevent fetching of all branches. 
# Example, with OpenCV 2.4 branch:
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
Posted by: Guest on October-09-2021
1

clone commit of a branch

> git clone -b <branch-name> <remote-repo>
> cd <repo-name>
> git checkout -b <new-branch-name> <commit-id>
> code .
Posted by: Guest on October-06-2021

Code answers related to "how to clone a code for specific branch in git"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language