I want to clone a specific branch. I don't want download the master
branch.
How do I clone the whole project and then switch to validations
branch?
There are two ways to clone a specific branch. You can either: Clone the repository, fetch all branches, and checkout to a specific branch immediately. Clone the repository and fetch only a single branch.
In order to clone a specific branch, you have to execute “git branch” with the “-b” and specify the branch you want to clone. $ git clone -b dev https://github.com/username/project.git Cloning into 'project'... remote: Enumerating objects: 813, done.
You can clone a single branch (without inadvertently cloning the whole project) with the following:
git clone <url> --branch <branch> --single-branch [<folder>]
Alternatively (attempting to address your new question here...), you can clone the whole project
git clone <url>
Change directories into the folder and creating a new branch off of master with
git checkout -b validations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With