Clone and checkout branch in one command

Clone and checkout branch in one command

When I need to clone a repo from GitLab I always type normal clone command then go inside the folder of project to change the branch. However, i found a simple and fast way to doing that:

Bad way ❌❌❌:

git clone GITLAP_REPO_URL
cd PROJECT_FOLDER
git checkout -b BRANCH_NAME

Simple and Fast way ✅✅✅:

git clone -b BRANCH_NAME GITLAP_REPO_URL