clone sub-branch from github

Git  clone can only clone the master branch of the remote library, but cannot clone all branches. The solution is as follows:

1. Find a clean directory, let's say git_work
2. cd git_work
3. git clone http://myrepo.xxx.com/project/.git , so you will get a project subdirectory in the git_work directory
4. cd project
5. git branch -a, list all the branch names as follows:
remotes/origin/dev
remotes/origin/release
6. git checkout -b dev origin/dev, the function is to checkout the remote dev branch, name the dev branch locally, and switch Go to the local dev branch
7. git checkout -b release origin/release, see the explanation in the previous step
8. git checkout dev, switch back to the dev branch, and start developing.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326864981&siteId=291194637