一般来讲
git clone -b <branch> <remote_repo>
以下面的内容为例
git clone -b release https://github.com/OpenImageIO/oiio.git
此处的 -b 表示要从branch上git clone,release 表示具体的分支名称,https://github.com/OpenImageIO/oiio.git 是code所在源码的git仓库地址,是所有该项目中分支共用的地址(不存在某个branch仓库地址的说法)。
根据说明:
The release branch is very stable and promises to never break back-compatibility with APIs or linkage within that release. The master branch is where new development happens; it tends to be very solid code but its APIs may change at any time.
我找到自己想下载的代码该代码位于 <>code 下面的 Branch: release 中,如下图所示,前面有 √ 标志的即是当前选择的分支。
然后复制git仓库地址,如下图所示。
最后在终端输入 git clone -b release https://github.com/OpenImageIO/oiio.git 回车即可得到所需分支。