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
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. 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 2023 | Privacy Policy | About Us | Contact Us | Sitemap