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,

git clone -b <branch_name> <remote_repo_url> 

% git clone us-east-1-branch
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) 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:

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