1## 获取源码 2 3* 步骤1:注册码云[gitee账号](https://gitee.com/signup)。 4* 步骤2:在Ubuntu的用户目录下,分步执行下面的命令,安装[git客户端](https://git-scm.com/book/zh/v2/起步-安装-Git)和[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。 5 6``` 7sudo apt install git git-lfs curl -y 8 9git config --global user.name "yourname" # 你自己gitee的用户名 10 11git config --global user.email "your-email-address" # 你自己gitee绑定的邮箱地址 12 13git config --global credential.helper store 14``` 15 16* 步骤3:在Ubuntu的用户目录下,分步执行下面的命,安装码云repo工具 17 18``` 19curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > repo 20 21sudo cp repo /usr/local/bin/repo 22 23sudo chmod a+x /usr/local/bin/repo 24 25pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests 26``` 27 28* 步骤4:分步执行下面的命令,配置python3环境 29 30``` 31cd /usr/bin 32 33sudo ln -s /usr/bin/python3.8 python 34``` 35 36* 步骤5:执行下面的命令,通过repo + https下载**OpenHarmony**主干代码 37 38``` 39cd ~ 40 41mkdir OpenHarmony_master 42 43cd OpenHarmony_master 44 45repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify 46 47repo sync -c 48 49repo forall -c 'git lfs pull' 50 51repo forall -c git checkout -b weekly_20220419 52 53bash build/prebuilts_download.sh 54``` 55 56