GIT: how to clone a specific branch


Git logo

You can use this command:

git clone -b <branchname> <repo>

or

git clone --branch <branchname> <repo>

Example 1:

git clone -b repcached https://github.com/mdounin/memcached.git

Example 2:

git clone -b development git@github.com:username/project.git

Leave a Reply