xxxxxxxxxx
git clone -b <branchname> <remote-repo-url>
xxxxxxxxxx
git clone -b <branch name> --single-branch https://github.com/<user name>/<repo>.git
xxxxxxxxxx
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git
xxxxxxxxxx
# 1. Switch to the repository's directory
cd /path/to/repository
# 2. Create a new branch
git branch new-branch-name original-branch-name
# 3. Push the new branch to the remote repository if desired
git push origin new-branch-name