Git-repo & gerrit笔记

对于repo来说,一个版本称为项目(REVISION来标识),git仓库称为project

参考资料:

https://m.yisu.com/zixun/109646.html git-repo

https://backlog.com/git-tutorial/cn/stepup/stepup2_8.html rebase (从分支树分叉开始全都调整过去: 在需要变基的提交上执行git rebase 新的基)

https://blog.csdn.net/FightFightFight/article/details/81039050 cherry-pick (只pick出单独一个提交的修改,父节点不pick)

https://gerrit-review.googlesource.com/Documentation/user-changeid.html changeId

https://segmentfault.com/a/1190000022970270 git hook(钩子)

 

清单库(manifest)

多个分支,每个分支可以多个清单文件
Repo init -u URL -b REVISION(repo的版本,体现在所有git的branch) -m XML(清单文件)
(不写-b就是HEAD分支,不写-m就是default清单文件)
1. 下载repo脚本完整版
2. clone清单库(manifests.git bare库)
3. clone清单库到本地(manifest目录),再简历.repo/manifest.xml的符号链接
(.repo/manifest.xml是当前选择的清单文件)

Xml中的一些定义
remote:
name就是 git中当时用到的origin,可以定义多个
fetch就是 remote 的url,git中用ssh或者http,'..'表示repo init -u 的url
default:
必须有一个默认清单,定义默认remote/revision (所有project(git库)的branch)

Repo sync
不存在则git clone
存在则fetch + rebase

Repo start (--all/[project])
在git-repo的REVISION(manifest清单定义的revision/manifest库的分支)上,建立新分支
Repo branches 查分支
Repo checkout 切分支
Repo abandon XXX 删除分支(git branch -D的封装)
Repo prune 扫描全部分支,删除已经合并的分支(git branch -d的封装)
(同git,当前分支unstated/staged状态下 不能随便建立和切换分支)

全局操作(工程太大运行非常慢,尽量用git指令)
Repo status
Repo diff
Repo stage => git add .
Repo forall -c =>运行shell命令

上传
Repo upload . 当前project
Repo upload 所有project上传

posted @ 2021-07-12 16:19  牧羊人邱Sir  阅读(242)  评论(0)    收藏  举报