测试
This commit is contained in:
20
.obsidian/workspace.json
vendored
20
.obsidian/workspace.json
vendored
@@ -13,12 +13,12 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "docs/学习笔记/gerrit分支规范.md",
|
||||
"file": "docs/Obsidian笔记体系/Areas/07-系统安全/密钥存储与加密.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "gerrit分支规范"
|
||||
"title": "密钥存储与加密"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -185,10 +185,16 @@
|
||||
},
|
||||
"active": "f1ecba89214e3cc5",
|
||||
"lastOpenFiles": [
|
||||
"docs/Obsidian笔记体系/Areas/07-系统安全/漏洞案例库.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/Launcher启动流程.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/README.md",
|
||||
"docs/Obsidian笔记体系/README.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/SystemServer核心服务.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/Zygote进程启动.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/Bootloader到Init.md",
|
||||
"docs/Obsidian/2026-01-05 个人文档管理.md",
|
||||
"docs/Obsidian笔记体系/Areas/01-系统启动流程/Bootloader到Init.md.bak",
|
||||
"docs/学习笔记/gerrit分支规范.md",
|
||||
"docs/Obsidian笔记体系/README.md",
|
||||
"docs/Obsidian笔记体系/MOCs/Android Framework知识体系图.md",
|
||||
"docs/Obsidian笔记体系/MOCs/源码阅读地图.md",
|
||||
"docs/Obsidian笔记体系/MOCs/高频问题索引.md",
|
||||
@@ -209,17 +215,11 @@
|
||||
"docs/Obsidian笔记体系/Config/自定义脚本/源码链接生成器.py",
|
||||
"docs/Obsidian笔记体系/Config/自定义脚本/自动生成日报.js",
|
||||
"docs/Obsidian笔记体系/Config/主题与样式.css",
|
||||
"docs/Obsidian笔记体系/Templates/源码解析模板.md",
|
||||
"docs/Obsidian笔记体系/Templates/会议记录模板.md",
|
||||
"docs/Obsidian笔记体系/Templates/技术方案设计模板.md",
|
||||
"docs/Obsidian笔记体系/Templates/问题排查模板.md",
|
||||
"docs/Obsidian笔记体系/MOCs/技能提升路线图.md",
|
||||
"docs/Obsidian笔记体系/Config/自定义脚本",
|
||||
"docs/Obsidian笔记体系/Daily/templates",
|
||||
"docs/Obsidian笔记体系/Archive/资源-历史会议记录",
|
||||
"docs/Obsidian笔记体系/Archive/领域-已废弃API研究",
|
||||
"docs/Obsidian笔记体系/Archive/项目-旧版ROM适配",
|
||||
"docs/Obsidian笔记体系/Resources/会议与分享/内部技术分享记录",
|
||||
"docs/Obsidian笔记体系/Resources/会议与分享/Android开发者峰会笔记"
|
||||
"docs/Obsidian笔记体系/Resources/会议与分享/内部技术分享记录"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
BIN
docs/Obsidian笔记体系/Areas/01-系统启动流程/Bootloader到Init.md.bak
Normal file
BIN
docs/Obsidian笔记体系/Areas/01-系统启动流程/Bootloader到Init.md.bak
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,128 +1,128 @@
|
||||
推荐标准分支模型: master/main主干分支 永远保持可编译、可运行 release-* 发布分支 只合并经过验证的Change hotfix-* 紧急修复
|
||||
|
||||
|
||||
您总结的Gerrit分支创建流程非常准确和实用!以下是对您提供内容的梳理和补充,使其更加清晰系统化。
|
||||
|
||||
## Gerrit 分支管理全流程
|
||||
|
||||
### 一、权限说明(重要前提)
|
||||
- **Owner/Maintainer**:有权限创建新分支
|
||||
- **Developer**:默认只能推送提交到现有分支,不能创建新分支
|
||||
- **权限配置路径**:Project → Access → Reference: refs/heads/*
|
||||
|
||||
### 二、分支创建详细步骤
|
||||
|
||||
#### 1. master/main分支(主干分支)
|
||||
```bash
|
||||
# 如果仓库为空,需要初始化master分支
|
||||
git clone ssh://user@gerrit-ip:29418/project-name
|
||||
cd project-name
|
||||
git checkout -b master
|
||||
# 首次推送master分支(不走Review流程)
|
||||
git push origin master
|
||||
```
|
||||
|
||||
#### 2. release-*分支(发布分支)
|
||||
```bash
|
||||
# 1. 更新master分支
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
# 2. 创建本地release分支
|
||||
git checkout -b release-1.0
|
||||
|
||||
# 3. 推送到Gerrit创建远程分支
|
||||
git push origin release-1.0
|
||||
# 注意:这里直接push,不是refs/for/
|
||||
```
|
||||
|
||||
#### 3. hotfix-*分支(紧急修复分支)
|
||||
```bash
|
||||
# 从release分支创建
|
||||
git checkout release-1.0
|
||||
git pull
|
||||
git checkout -b hotfix-crash-123
|
||||
git push origin hotfix-crash-123
|
||||
|
||||
# 从master分支创建(如果未建立release分支)
|
||||
git checkout master
|
||||
git pull
|
||||
git checkout -b hotfix-issue-456
|
||||
git push origin hotfix-issue-456
|
||||
```
|
||||
|
||||
### 三、不同分支的提交方式差异
|
||||
|
||||
| 分支类型 | 推送命令 | 是否走Review | 说明 |
|
||||
|---------|---------|-------------|------|
|
||||
| 创建新分支 | `git push origin 分支名` | ❌ 否 | 直接创建分支 |
|
||||
| master分支提交 | `git push origin HEAD:refs/for/master` | ✅ 是 | 常规开发流程 |
|
||||
| release分支提交 | `git push origin HEAD:refs/for/release-1.0` | ✅ 是 | 修复bug流程 |
|
||||
| hotfix分支提交 | `git push origin HEAD:refs/for/hotfix-*` | ✅ 是 | 紧急修复流程 |
|
||||
|
||||
### 四、分支合并策略
|
||||
|
||||
#### hotfix修复后的合并流程:
|
||||
```bash
|
||||
# 1. 修复完成后,合并到release分支
|
||||
git checkout release-1.0
|
||||
git merge --no-ff hotfix-crash-123
|
||||
git push origin HEAD:refs/for/release-1.0
|
||||
|
||||
# 2. cherry-pick到master
|
||||
git checkout master
|
||||
git cherry-pick <hotfix-commit-id>
|
||||
git push origin HEAD:refs/for/master
|
||||
```
|
||||
|
||||
### 五、最佳实践建议
|
||||
|
||||
1. **分支命名规范**:
|
||||
- feature/xxx(功能分支,从master创建)
|
||||
- release/x.y.z(发布分支)
|
||||
- hotfix/xxx(紧急修复)
|
||||
- bugfix/xxx(普通bug修复)
|
||||
|
||||
2. **权限管理**:
|
||||
```bash
|
||||
# 为开发者授予特定分支创建权限(Gerrit Web界面)
|
||||
# Access → Reference: refs/heads/feature/*
|
||||
# 添加 Push + Create Reference 权限给特定用户组
|
||||
```
|
||||
|
||||
3. **CI/CD集成**:
|
||||
- release-* 分支:触发正式环境构建
|
||||
- hotfix-* 分支:紧急修复通道,快速验证
|
||||
- master分支:每日/持续集成
|
||||
|
||||
4. **分支保护**:
|
||||
- 保护master分支:必须通过Code Review
|
||||
- 保护release分支:限制直接push,需通过Review
|
||||
- 定期清理过期分支
|
||||
|
||||
### 六、常见问题排查
|
||||
|
||||
1. **权限拒绝错误**:
|
||||
```
|
||||
! [remote rejected] release-1.0 -> release-1.0 (prohibited by Gerrit)
|
||||
```
|
||||
解决方法:联系Owner/Maintainer授予分支创建权限
|
||||
|
||||
2. **分支已存在错误**:
|
||||
```bash
|
||||
# 先拉取远程分支列表
|
||||
git fetch origin
|
||||
git branch -r # 查看远程分支
|
||||
```
|
||||
|
||||
3. **使用Gerrit插件创建分支**(可选):
|
||||
```bash
|
||||
# 安装git-review插件
|
||||
pip install git-review
|
||||
|
||||
# 创建分支并推送到Gerrit
|
||||
git review -c -b release-1.0
|
||||
```
|
||||
|
||||
您的总结已经非常全面,这些补充主要是为了让操作流程更加清晰,便于团队协作和标准化操作。
|
||||
|
||||
推荐标准分支模型: master/main主干分支 永远保持可编译、可运行 release-* 发布分支 只合并经过验证的Change hotfix-* 紧急修复
|
||||
|
||||
|
||||
您总结的Gerrit分支创建流程非常准确和实用!以下是对您提供内容的梳理和补充,使其更加清晰系统化。
|
||||
|
||||
## Gerrit 分支管理全流程
|
||||
|
||||
### 一、权限说明(重要前提)
|
||||
- **Owner/Maintainer**:有权限创建新分支
|
||||
- **Developer**:默认只能推送提交到现有分支,不能创建新分支
|
||||
- **权限配置路径**:Project → Access → Reference: refs/heads/*
|
||||
|
||||
### 二、分支创建详细步骤
|
||||
|
||||
#### 1. master/main分支(主干分支)
|
||||
```bash
|
||||
# 如果仓库为空,需要初始化master分支
|
||||
git clone ssh://user@gerrit-ip:29418/project-name
|
||||
cd project-name
|
||||
git checkout -b master
|
||||
# 首次推送master分支(不走Review流程)
|
||||
git push origin master
|
||||
```
|
||||
|
||||
#### 2. release-*分支(发布分支)
|
||||
```bash
|
||||
# 1. 更新master分支
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
# 2. 创建本地release分支
|
||||
git checkout -b release-1.0
|
||||
|
||||
# 3. 推送到Gerrit创建远程分支
|
||||
git push origin release-1.0
|
||||
# 注意:这里直接push,不是refs/for/
|
||||
```
|
||||
|
||||
#### 3. hotfix-*分支(紧急修复分支)
|
||||
```bash
|
||||
# 从release分支创建
|
||||
git checkout release-1.0
|
||||
git pull
|
||||
git checkout -b hotfix-crash-123
|
||||
git push origin hotfix-crash-123
|
||||
|
||||
# 从master分支创建(如果未建立release分支)
|
||||
git checkout master
|
||||
git pull
|
||||
git checkout -b hotfix-issue-456
|
||||
git push origin hotfix-issue-456
|
||||
```
|
||||
|
||||
### 三、不同分支的提交方式差异
|
||||
|
||||
| 分支类型 | 推送命令 | 是否走Review | 说明 |
|
||||
|---------|---------|-------------|------|
|
||||
| 创建新分支 | `git push origin 分支名` | ❌ 否 | 直接创建分支 |
|
||||
| master分支提交 | `git push origin HEAD:refs/for/master` | ✅ 是 | 常规开发流程 |
|
||||
| release分支提交 | `git push origin HEAD:refs/for/release-1.0` | ✅ 是 | 修复bug流程 |
|
||||
| hotfix分支提交 | `git push origin HEAD:refs/for/hotfix-*` | ✅ 是 | 紧急修复流程 |
|
||||
|
||||
### 四、分支合并策略
|
||||
|
||||
#### hotfix修复后的合并流程:
|
||||
```bash
|
||||
# 1. 修复完成后,合并到release分支
|
||||
git checkout release-1.0
|
||||
git merge --no-ff hotfix-crash-123
|
||||
git push origin HEAD:refs/for/release-1.0
|
||||
|
||||
# 2. cherry-pick到master
|
||||
git checkout master
|
||||
git cherry-pick <hotfix-commit-id>
|
||||
git push origin HEAD:refs/for/master
|
||||
```
|
||||
|
||||
### 五、最佳实践建议
|
||||
|
||||
1. **分支命名规范**:
|
||||
- feature/xxx(功能分支,从master创建)
|
||||
- release/x.y.z(发布分支)
|
||||
- hotfix/xxx(紧急修复)
|
||||
- bugfix/xxx(普通bug修复)
|
||||
|
||||
2. **权限管理**:
|
||||
```bash
|
||||
# 为开发者授予特定分支创建权限(Gerrit Web界面)
|
||||
# Access → Reference: refs/heads/feature/*
|
||||
# 添加 Push + Create Reference 权限给特定用户组
|
||||
```
|
||||
|
||||
3. **CI/CD集成**:
|
||||
- release-* 分支:触发正式环境构建
|
||||
- hotfix-* 分支:紧急修复通道,快速验证
|
||||
- master分支:每日/持续集成
|
||||
|
||||
4. **分支保护**:
|
||||
- 保护master分支:必须通过Code Review
|
||||
- 保护release分支:限制直接push,需通过Review
|
||||
- 定期清理过期分支
|
||||
|
||||
### 六、常见问题排查
|
||||
|
||||
1. **权限拒绝错误**:
|
||||
```
|
||||
! [remote rejected] release-1.0 -> release-1.0 (prohibited by Gerrit)
|
||||
```
|
||||
解决方法:联系Owner/Maintainer授予分支创建权限
|
||||
|
||||
2. **分支已存在错误**:
|
||||
```bash
|
||||
# 先拉取远程分支列表
|
||||
git fetch origin
|
||||
git branch -r # 查看远程分支
|
||||
```
|
||||
|
||||
3. **使用Gerrit插件创建分支**(可选):
|
||||
```bash
|
||||
# 安装git-review插件
|
||||
pip install git-review
|
||||
|
||||
# 创建分支并推送到Gerrit
|
||||
git review -c -b release-1.0
|
||||
```
|
||||
|
||||
您的总结已经非常全面,这些补充主要是为了让操作流程更加清晰,便于团队协作和标准化操作。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user