Clone
8
v3_CN_Git
winlin edited this page 2022-01-06 11:57:15 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

HOME > CN > GIT Repository

GIT

Note: 如果觉得Github的Wiki访问太慢可以访问 Gitee 镜像。

如何选择SRS的稳定版本如何更新代码

Fast Checkout

很多人希望缩减仓库大小很多doc和3rdparty中的第三方代码压缩包。我在这里集中说明一次为何需要把doc收集那么全这个不言自明srs中23%的代码都是注释注释会说明是哪个文档的哪一页难道还需要再下载一次这个文档吗为何需要把依赖的第三方代码放进来譬如ffmpeg和nignx还有openssl再去下载这些相关的程序会比较麻烦而且对于新手来说下载正确的版本和编译都是比较复杂的问题。为了好用大一点的仓库我觉得而是可以接受的。

为何不做这些改变这些是次要复杂度仓库多大对于代码质量没有任何影响。而且更重要的是国内很多git镜像站点SRS是同步更新的阿里云提供服务的oschina我git clone一次是40秒左右。这个问题就变成一个小问题了。

如何使用国内镜像站点clone然后把服务器设置为github上这样和直接从github上clone一模一样了。执行下面的命令就可以了

git clone -b 3.0release https://gitee.com/ossrs/srs.git && 
cd srs && git remote set-url origin https://github.com/ossrs/srs.git

其他国内镜像参考:https://github.com/ossrs/srs/tree/develop#mirrors

Checkout Branch

有些功能只有SRS2.0有SRS1.0没有请注意看wiki是v1还是v2的。

如果是1.0的功能更新代码后要改变到1.0分支:

git pull && git checkout 1.0release

如果是2.0的功能更新代码后要改变到2.0分支:

git pull && git checkout 2.0release

如果是3.0的功能更新代码后要改变到3.0分支没有单独的3.0release分支就是develop

git pull && git checkout develop

SRS Branches

稳定的SRS版本会新建branch譬如1.0release或2.0release。1.0release是1.0的release有最新的bug fix。

Master分支目前用做了链接和说明。

所以稳定度 2.0release/1.0release >> develop.

Get SRS Code

注意中国国内访问github慢可以使用oschina或csdn镜像参考下面的其他镜像。

你可以从github获取SRS的代码需要先安装git如何安装git可以百度下

安装好git后执行以下命令获取SRS最新代码

git clone https://github.com/ossrs/srs

其他镜像git地址: https://github.com/ossrs/srs/tree/develop#mirrors

Update SRS Code

SRS包含的软件很多不需要额外下载其他的包就可以编译。所以第一次从github上下载后不需要每次都git clone用以下命令即可更新

git pull

另外不需要删除objs后编译srs只需要make就可以编译。若make出错则执行configure之后再make可能有配置项更新。

Fetch and Push

具体参考:Pro Git

Patch

可以生成patch后发送邮件给winlin at vip.126.com例如针对SRS2的patch

git format-patch origin/2.0release

Winlin 2014.3