Files
docker-backup/llmdoc/reference/git-conventions.md
Wang Defa 4d00283654 feat: 实现 Docker 备份系统,支持远程一键安装
实现功能:
- 文件夹和 MySQL 容器数据库备份
- tar.gz 压缩和自动清理旧备份
- systemd 定时任务集成
- 远程一键安装脚本(通过 Gitea 仓库)
- 完整的 llmdoc 文档系统

安装方式:
bash <(curl -sL https://gitea.bcde.io/wangdefa/docker-backup/raw/branch/main/install.sh)

配置文件位置:/etc/docker-backup/config.yml
命令:docker-backup, docker-backup-cleanup
2025-12-25 15:02:07 +08:00

88 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Git 约定
## 1. 分支策略
### 主分支
- **主分支名称**`main`
- **主分支规则**
- 始终保持稳定和可部署状态
- 直接对应生产环境
- 受保护分支,需要代码审查才能合并
### 开发分支类型
- `feature/[功能名称]`:新功能开发
- `bugfix/[问题描述]`:修复特定 bug
- `hotfix/[紧急问题]`:生产环境紧急修复
- `docs/[文档内容]`:文档更新
- `refactor/[模块名称]`:代码重构
## 2. 提交消息格式
提交消息应遵循语义化提交规范:
```
<type>(<scope>): <description>
[可选的详细描述]
- 可选的脚注信息
```
### 类型 (Type)
- `feat`: 新功能
- `fix`: 修复 bug
- `docs`: 文档变更
- `style`: 代码格式调整
- `refactor`: 代码重构
- `test`: 测试相关
- `chore`: 构建过程或辅助工具变更
### 示例提交消息
```
feat(auth): 添加用户注册功能
- 实现基于电子邮件的用户注册流程
- 集成用户验证机制
```
## 3. 推荐工作流程
1.`main` 创建功能分支
```bash
git checkout -b feature/new-feature main
```
2. 进行开发并频繁提交
```bash
git add .
git commit -m "feat(module): 描述具体变更"
```
3. 推送分支到远程仓库
```bash
git push -u origin feature/new-feature
```
4. 创建 Pull Request
- 目标分支:`main`
- 包含详细的变更说明
- 等待代码审查和批准
5. 合并后清理分支
```bash
git checkout main
git pull
git branch -d feature/new-feature
```
## 4. 其他最佳实践
- 保持提交原子化和有意义
- 编写清晰、简洁的提交消息
- 避免在一个提交中包含多个无关的变更
- 使用 `.gitignore` 排除不需要版本控制的文件
## 5. 推荐工具
- Git 提交检查:`pre-commit`
- 代码审查GitHub/GitLab Pull Request