2018-11-27 14:14:51 +08:00
|
|
|
|
# Repo 使用
|
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
先
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
vim /usr/bin/repo
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
将 REPO_URL 修改为 '<https://mirrors.tuna.tsinghua.edu.cn/git/git-repo>'。
|
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
## 创建并切换分支
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
repo start <新分支名> --all
|
|
|
|
|
```
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
## 查看分支
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
repo branches
|
|
|
|
|
```
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
## 切换分支
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
repo checkout <远程分支名>
|
|
|
|
|
```
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
## 提交代码
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
git commit -asm <Commit信息>
|
|
|
|
|
```
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
## Push 代码
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
git push <远程主机名> <本地分支名>:refs/for/<远程分支名>
|
|
|
|
|
git push <远程主机名> <本地分支名>:refs/drafts/<远程分支名>
|
|
|
|
|
```
|
2018-11-27 14:14:51 +08:00
|
|
|
|
|
|
|
|
|
## Gerrit 服务器 Android 使用
|
|
|
|
|
|
2019-07-25 13:29:09 +08:00
|
|
|
|
ACRN:
|
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
repo init -u ssh://cheny@10.20.0.34:29418/manifests -b oa/gordon_peak_acrn/a90/rel -m manifest-AAH.xml
|
|
|
|
|
repo sync -j<线程数>
|
|
|
|
|
```
|
2019-07-25 13:29:09 +08:00
|
|
|
|
|
|
|
|
|
Nitc:
|
|
|
|
|
|
2020-01-08 16:56:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
repo init -u ssh://chensf@10.20.3.17:29418/manifests -b nitc
|
|
|
|
|
repo sync -j<线程数>
|
|
|
|
|
```
|