# Git 提交规范 > **版本:** v1.0 > **创建日期:** 2025-11-16 > **适用范围:** 全项目(前端 + 后端 + 文档) > **优先级:** ⭐⭐⭐⭐⭐ P0 必须遵守 --- ## 📋 目录 1. [远程仓库配置](#远程仓库配置) 2. [Commit Message 规范](#commit-message-规范) 3. [提交频率与时机](#提交频率与时机) ⭐ 重要原则 4. [分支管理策略](#分支管理策略) 5. [中文编码问题解决](#中文编码问题解决) 6. [Git 历史重写与维护](#git-历史重写与维护) 7. [代码审查流程](#代码审查流程) 8. [常见问题与最佳实践](#常见问题与最佳实践) --- ## 远程仓库配置 ### 🌐 Gitee 仓库信息 **仓库地址:** ``` https://gitee.com/hahafeng117/AIclinicalresearch.git ``` **全局配置:** ```bash git config --global user.name "HaHafeng" git config --global user.email "gofeng117@163.com" ``` **中文编码配置:** ⭐ 重要 ```bash # 确保 Git 正确处理中文文件名和提交信息 git config --global core.quotepath false git config --global gui.encoding utf-8 git config --global i18n.commit.encoding utf-8 git config --global i18n.logoutputencoding utf-8 ``` **PowerShell 配置:** ```powershell # 在 PowerShell Profile 中添加($PROFILE 文件) [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $env:LESSCHARSET = 'utf-8' ``` ### 克隆仓库 ```bash # 初次克隆 git clone https://gitee.com/hahafeng117/AIclinicalresearch.git # 查看远程仓库 git remote -v ``` --- ## Commit Message 规范 ### ⚠️ 重要提示:避免中文乱码 **强制要求:Commit Message 必须使用英文** ⭐⭐⭐ **原因**: - Windows PowerShell 环境下,Git commit message 中的中文会出现乱码 - 中文乱码会导致提交历史难以阅读,影响团队协作 - 英文 commit message 是国际开源项目的标准实践 **✅ 正确示例:** ```bash git commit -m "feat(asl): Implement full-text screening core service" git commit -m "fix(frontend): Fix dropdown menu click issue" git commit -m "docs: Add development guide for Day 2-3" ``` **❌ 错误示例:** ```bash git commit -m "feat(asl): 实现全文复筛核心服务" # 会出现乱码 git commit -m "修复下拉菜单问题" # 会出现乱码 ``` **例外情况**: - 文件名和文件内容可以使用中文(Git 能正确处理 UTF-8 编码的文件) - 仅 commit message 必须使用英文 --- ### 📝 格式规范 **标准格式:** ``` ():