GIT Clone a branch

GIT Clone a branch

You might find a need some time to clone a certain branch of a repository instead of the entire repository.

The following should be able to do the trick for you.

GIT Clone a branch

[[email protected] ~]# git clone -b BRANCH_NAME REPOSITORY_PATH

So, we will take example of branch release_10 from a repository website_code.

So in order to clone just the branch release_10 from the repository website_code, we will use the following command.

[[email protected] ~]# git clone -b release_10 [email protected]:website_code.git

Output:

[[email protected] ~]# git clone -b release_10 [email protected]:website_code.git

Cloning into website_code...
remote: Counting objects: 194, done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 194 (delta 84), reused 114 (delta 59)
Receiving objects: 100% (194/194), 11.16 MiB, done.
Resolving deltas: 100% (84/84), done.

GIT Clone a branch

No Comments

Post a Comment

Time limit is exhausted. Please reload CAPTCHA.