Clone a particular remote brach using git clone command


Git Clone branch cover

If you want to clone a remote repository in git, but you do not want to clone out the default master of the main branch from the origin, well you can do that using the following way,


Syntax:
git clone -b <branch_name> <remote_repo_url> 

Example:
% git clone us-east-1-branch https://github.com/code2care/CustomRatingBarExample.git
Git clone a specific branch from remote origin
Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org










Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap