源码获取
前提条件
git config --global user.name "yourname" # 这得和gitee的账号对的上
git config --global user.email "your-email-address"
git config --global credential.helper store
- 安装码云repo工具
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo #如果没有权限,可下载至其他目录,并将其配置到环境变量中chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
通过repo获取
方式一(推荐)
通过repo + ssh 下载(需注册公钥,请参考码云帮助中心)。
- 从版本分支获取源码。可获取该版本分支的最新源码,包括版本发布后在该分支的合入。
repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
- 从版本发布Tag节点获取源码。可获取与版本发布时完全一致的源码。
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
方式二
通过repo + https 下载。
- 从版本分支获取源码。可获取该版本分支的最新源码,包括版本发布后在该分支的合入。
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
- 从版本发布Tag节点获取源码。可获取与版本发布时完全一致的源码。
repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
从镜像站点获取
表2 获取源码路径
版本源码 | 版本信息 | 下载站点 | SHA256校验码 | 软件包容量 |
---|---|---|---|---|
全量代码(标准、轻量和小型系统) | 5.1.0 Release | 站点 | SHA256校验码 | 49.1 GB |
Hi3861解决方案(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 28.4 MB |
Hi3516解决方案-LiteOS(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 350.0 MB |
Hi3516解决方案-Linux(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 223.6 MB |
RK3568标准系统解决方案(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 9.7 GB |
标准系统Public SDK包(Mac) | 5.1.0.107 | 站点 | SHA256校验码 | 1.3 GB |
标准系统Public SDK包(Mac-M1) | 5.1.0.107 | 站点 | SHA256校验码 | 1.2 GB |
标准系统Public SDK包(Windows/Linux) | 5.1.0.107 | 站点 | SHA256校验码 | 3.2 GB |
下载过程中的异常
1.error: Cannot checkout applications_app_samples: ManifestInvalidRevisionError: revision OpenHarmony-5.1.0-Release in applications_app_samples not found error: in sync -c
: revision OpenHarmony-5.1.0-Release in applications_app_samples not found
#换了这个tag重新下载
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
2.请在切换分支前移动或删除。
正在终止
error: base/update/update_app/: update_update_app checkout 7bf93cd366082902748c06e63c8726c18c935f10
error: Cannot checkout update_update_app
git-lfs filter-process --skip: 1: git-lfs: not found
fatal: 远端意外挂断了
sudo apt-get install git-lfs
3.Try re-running with “-j1 --fail-fast” to exit at the first error.
repo sync -c -j1 --fail-fast
4.error: applications/standard/app_samples/: applications_app_samples checkout
类似的问题都这样解决
cd applications/standard/app_samples
git status # 查看是否有未提交的修改
git reset --hard # 强制重置到当前提交,丢弃所有未提交的修改
git clean -fdx # 删除未跟踪的文件和目录
cd ../../../.. # 返回仓库根目录
repo sync -c -j1 --fail-fast