[{"data":1,"prerenderedAt":4280},["ShallowReactive",2],{"it-list":3},[4,1326],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"date":11,"tags":12,"body":14,"_type":1320,"_id":1321,"_source":1322,"_file":1323,"_stem":1324,"_extension":1325},"\u002Fit\u002F001","it",false,"","Claude Code 全局配置文档","配置 Claude Code 全局配置文档 ~\u002Fclaude\u002FCLAUDE.md","2026-06-14",[13],"Claude Code",{"type":15,"children":16,"toc":1295},"root",[17,26,32,88,98,104,197,203,210,263,269,310,316,341,347,375,381,411,417,423,499,505,548,554,560,581,724,730,830,836,845,1028,1034,1214,1220,1256,1262],{"type":18,"tag":19,"props":20,"children":22},"element","h2",{"id":21},"一身份与工作上下文",[23],{"type":24,"value":25},"text","一、身份与工作上下文",{"type":18,"tag":27,"props":28,"children":29},"p",{},[30],{"type":24,"value":31},"我是一名以前端技术栈为核心的全栈开发者，工作内容涵盖：",{"type":18,"tag":33,"props":34,"children":35},"ul",{},[36,48,58,68,78],{"type":18,"tag":37,"props":38,"children":39},"li",{},[40,46],{"type":18,"tag":41,"props":42,"children":43},"strong",{},[44],{"type":24,"value":45},"前端",{"type":24,"value":47},"：HTML \u002F CSS \u002F JavaScript \u002F TypeScript，主框架为 Vue 3（Composition API），少量 React",{"type":18,"tag":37,"props":49,"children":50},{},[51,56],{"type":18,"tag":41,"props":52,"children":53},{},[54],{"type":24,"value":55},"跨端开发",{"type":24,"value":57},"：UniApp、微信小程序（原生）",{"type":18,"tag":37,"props":59,"children":60},{},[61,66],{"type":18,"tag":41,"props":62,"children":63},{},[64],{"type":24,"value":65},"后端服务",{"type":24,"value":67},"：Node.js，主要框架为 Express.js \u002F Koa.js \u002F NestJS",{"type":18,"tag":37,"props":69,"children":70},{},[71,76],{"type":18,"tag":41,"props":72,"children":73},{},[74],{"type":24,"value":75},"数据库",{"type":24,"value":77},"：MySQL（关系型）、MongoDB（文档型）",{"type":18,"tag":37,"props":79,"children":80},{},[81,86],{"type":18,"tag":41,"props":82,"children":83},{},[84],{"type":24,"value":85},"产品设计",{"type":24,"value":87},"：Figma UI\u002FUX 交互设计、图片素材处理（压缩 \u002F 裁切 \u002F 格式转换）、设计规范维护",{"type":18,"tag":27,"props":89,"children":90},{},[91,96],{"type":18,"tag":41,"props":92,"children":93},{},[94],{"type":24,"value":95},"默认语言",{"type":24,"value":97},"：中文交流，代码注释可视情况使用中文或英文",{"type":18,"tag":19,"props":99,"children":101},{"id":100},"二核心行为准则non-negotiable",[102],{"type":24,"value":103},"二、核心行为准则（NON-NEGOTIABLE）",{"type":18,"tag":105,"props":106,"children":107},"ol",{},[108,118,128,147,157,167,177,187],{"type":18,"tag":37,"props":109,"children":110},{},[111,116],{"type":18,"tag":41,"props":112,"children":113},{},[114],{"type":24,"value":115},"优先阅读现有代码",{"type":24,"value":117},"：修改前必须先理解现有代码结构和风格，不随意引入新的依赖或模式",{"type":18,"tag":37,"props":119,"children":120},{},[121,126],{"type":18,"tag":41,"props":122,"children":123},{},[124],{"type":24,"value":125},"最小化改动",{"type":24,"value":127},"：只修改与任务直接相关的部分，不做\"顺手\"重构",{"type":18,"tag":37,"props":129,"children":130},{},[131,136,138,145],{"type":18,"tag":41,"props":132,"children":133},{},[134],{"type":24,"value":135},"类型安全优先",{"type":24,"value":137},"：TypeScript 项目中，禁止使用 ",{"type":18,"tag":139,"props":140,"children":142},"code",{"className":141},[],[143],{"type":24,"value":144},"any",{"type":24,"value":146},"，必须给出明确类型定义",{"type":18,"tag":37,"props":148,"children":149},{},[150,155],{"type":18,"tag":41,"props":151,"children":152},{},[153],{"type":24,"value":154},"不自作主张删除代码",{"type":24,"value":156},"：有疑问时注释掉而非直接删除，并说明原因",{"type":18,"tag":37,"props":158,"children":159},{},[160,165],{"type":18,"tag":41,"props":161,"children":162},{},[163],{"type":24,"value":164},"执行破坏性操作前必须确认",{"type":24,"value":166},"：数据库写入 \u002F 删除、覆盖文件、生产环境操作，均须先向我确认",{"type":18,"tag":37,"props":168,"children":169},{},[170,175],{"type":18,"tag":41,"props":171,"children":172},{},[173],{"type":24,"value":174},"遇到不确定的问题，先说明再行动",{"type":24,"value":176},"：不要静默地做出可能有副作用的假设",{"type":18,"tag":37,"props":178,"children":179},{},[180,185],{"type":18,"tag":41,"props":181,"children":182},{},[183],{"type":24,"value":184},"验证驱动",{"type":24,"value":186},"：在证明功能正确之前，不标记任务完成。时刻自问：\"资深工程师会认可这个方案吗？\"",{"type":18,"tag":37,"props":188,"children":189},{},[190,195],{"type":18,"tag":41,"props":191,"children":192},{},[193],{"type":24,"value":194},"设计一致性",{"type":24,"value":196},"：代码还原设计稿时，像素级对齐不是可选而是默认。色彩、间距、字体必须与设计令牌（Design Token）一致",{"type":18,"tag":19,"props":198,"children":200},{"id":199},"三工作流规范workflow",[201],{"type":24,"value":202},"三、工作流规范（Workflow）",{"type":18,"tag":204,"props":205,"children":207},"h3",{"id":206},"_31-计划先行plan-first",[208],{"type":24,"value":209},"3.1 计划先行（Plan First）",{"type":18,"tag":33,"props":211,"children":212},{},[213,225,230,235,240,253],{"type":18,"tag":37,"props":214,"children":215},{},[216,218,223],{"type":24,"value":217},"涉及 3 步以上或架构决策的任务，",{"type":18,"tag":41,"props":219,"children":220},{},[221],{"type":24,"value":222},"必须先写 PLAN.md",{"type":24,"value":224}," 再编码",{"type":18,"tag":37,"props":226,"children":227},{},[228],{"type":24,"value":229},"前端任务需包含：组件拆分图、状态管理方案、API 依赖列表",{"type":18,"tag":37,"props":231,"children":232},{},[233],{"type":24,"value":234},"后端任务需包含：接口定义（OpenAPI\u002FTypeScript 类型）、数据库变更（ER 图\u002F迁移脚本）、权限校验点",{"type":18,"tag":37,"props":236,"children":237},{},[238],{"type":24,"value":239},"设计相关任务需包含：Figma 节点路径、资源导出规格、响应式断点策略",{"type":18,"tag":37,"props":241,"children":242},{},[243,245,251],{"type":24,"value":244},"按步骤顺序实现，完成后用 ",{"type":18,"tag":139,"props":246,"children":248},{"className":247},[],[249],{"type":24,"value":250},"[x]",{"type":24,"value":252}," 标记",{"type":18,"tag":37,"props":254,"children":255},{},[256,261],{"type":18,"tag":41,"props":257,"children":258},{},[259],{"type":24,"value":260},"计划服从现实",{"type":24,"value":262},"：发现计划与代码实际不符时，优先尊重现实；若计划明显错误，自行修正后继续",{"type":18,"tag":204,"props":264,"children":266},{"id":265},"_32-测试驱动开发tdd-后端优先",[267],{"type":24,"value":268},"3.2 测试驱动开发（TDD）— 后端优先",{"type":18,"tag":33,"props":270,"children":271},{},[272,305],{"type":18,"tag":37,"props":273,"children":274},{},[275,277],{"type":24,"value":276},"后端接口（Nest\u002FExpress）必须遵循 TDD：\n",{"type":18,"tag":105,"props":278,"children":279},{},[280,285,290,300],{"type":18,"tag":37,"props":281,"children":282},{},[283],{"type":24,"value":284},"先写测试（单元\u002F集成），确认失败（红）",{"type":18,"tag":37,"props":286,"children":287},{},[288],{"type":24,"value":289},"确认测试逻辑正确后，立即提交",{"type":18,"tag":37,"props":291,"children":292},{},[293,295],{"type":24,"value":294},"再写实现使测试通过（绿），",{"type":18,"tag":41,"props":296,"children":297},{},[298],{"type":24,"value":299},"实现过程中不得修改测试",{"type":18,"tag":37,"props":301,"children":302},{},[303],{"type":24,"value":304},"全部测试通过后，进行重构",{"type":18,"tag":37,"props":306,"children":307},{},[308],{"type":24,"value":309},"前端组件测试：关键交互组件（表单、弹窗、支付）必须写 Cypress\u002FPlaywright E2E 或 Vitest 单元测试",{"type":18,"tag":204,"props":311,"children":313},{"id":312},"_33-自主-bug-修复",[314],{"type":24,"value":315},"3.3 自主 Bug 修复",{"type":18,"tag":33,"props":317,"children":318},{},[319,331,336],{"type":18,"tag":37,"props":320,"children":321},{},[322,324,329],{"type":24,"value":323},"收到 Bug 报告后，",{"type":18,"tag":41,"props":325,"children":326},{},[327],{"type":24,"value":328},"直接调查并修复",{"type":24,"value":330},"，避免反复询问用户细节，减少上下文切换成本",{"type":18,"tag":37,"props":332,"children":333},{},[334],{"type":24,"value":335},"前端 Bug：先检查控制台报错、网络请求、状态流，再定位组件",{"type":18,"tag":37,"props":337,"children":338},{},[339],{"type":24,"value":340},"后端 Bug：先检查日志、数据库连接、接口入参，再定位服务层",{"type":18,"tag":204,"props":342,"children":344},{"id":343},"_34-ci-纪律",[345],{"type":24,"value":346},"3.4 CI 纪律",{"type":18,"tag":33,"props":348,"children":349},{},[350,360,365,370],{"type":18,"tag":37,"props":351,"children":352},{},[353,358],{"type":18,"tag":41,"props":354,"children":355},{},[356],{"type":24,"value":357},"CI 失败即最高优先级",{"type":24,"value":359},"：无论当前进行什么任务，立即暂停并修复 CI",{"type":18,"tag":37,"props":361,"children":362},{},[363],{"type":24,"value":364},"前端 CI 通常包含：Lint（ESLint\u002FPrettier）、类型检查（tsc --noEmit）、单元测试（Vitest）、构建（vite build）",{"type":18,"tag":37,"props":366,"children":367},{},[368],{"type":24,"value":369},"后端 CI 通常包含：Lint、测试、数据库迁移验证、Docker 构建",{"type":18,"tag":37,"props":371,"children":372},{},[373],{"type":24,"value":374},"修复后确认所有 CI 检查通过，再继续原任务",{"type":18,"tag":204,"props":376,"children":378},{"id":377},"_35-设计协作流程",[379],{"type":24,"value":380},"3.5 设计协作流程",{"type":18,"tag":33,"props":382,"children":383},{},[384,396,401,406],{"type":18,"tag":37,"props":385,"children":386},{},[387,389,394],{"type":24,"value":388},"从 Figma 开发时，",{"type":18,"tag":41,"props":390,"children":391},{},[392],{"type":24,"value":393},"优先使用 Figma Dev Mode 的 CSS 代码片段",{"type":24,"value":395},"，但需根据项目设计令牌调整",{"type":18,"tag":37,"props":397,"children":398},{},[399],{"type":24,"value":400},"导出图片资源时，优先使用 WebP\u002FAVIF 格式，提供 1x\u002F2x 多倍图",{"type":18,"tag":37,"props":402,"children":403},{},[404],{"type":24,"value":405},"设计稿中的图标必须使用项目统一的图标库（如 Iconify\u002F自定义 SVG），禁止直接导出 Figma 的 SVG（可能含冗余路径）",{"type":18,"tag":37,"props":407,"children":408},{},[409],{"type":24,"value":410},"响应式实现必须与 Figma 的断点标注一致（常见：768px、1024px、1440px）",{"type":18,"tag":19,"props":412,"children":414},{"id":413},"四技术规范tech-stack",[415],{"type":24,"value":416},"四、技术规范（Tech Stack）",{"type":18,"tag":204,"props":418,"children":420},{"id":419},"_41-前端通用规范",[421],{"type":24,"value":422},"4.1 前端通用规范",{"type":18,"tag":33,"props":424,"children":425},{},[426,431,436,448,453,474,479,484,489,494],{"type":18,"tag":37,"props":427,"children":428},{},[429],{"type":24,"value":430},"组件文件使用 PascalCase（MyComponent.vue）",{"type":18,"tag":37,"props":432,"children":433},{},[434],{"type":24,"value":435},"工具函数文件使用 camelCase（formatDate.ts）",{"type":18,"tag":37,"props":437,"children":438},{},[439,441,446],{"type":24,"value":440},"组件props、事件必须编写TS类型约束，杜绝",{"type":18,"tag":139,"props":442,"children":444},{"className":443},[],[445],{"type":24,"value":144},{"type":24,"value":447},"滥用",{"type":18,"tag":37,"props":449,"children":450},{},[451],{"type":24,"value":452},"优先使用组合式API \u002F Hooks，禁止混用老旧写法",{"type":18,"tag":37,"props":454,"children":455},{},[456,458,464,466,472],{"type":24,"value":457},"优先使用 ",{"type":18,"tag":139,"props":459,"children":461},{"className":460},[],[462],{"type":24,"value":463},"interface",{"type":24,"value":465}," 定义对象形状，",{"type":18,"tag":139,"props":467,"children":469},{"className":468},[],[470],{"type":24,"value":471},"type",{"type":24,"value":473}," 用于联合类型\u002F工具类型",{"type":18,"tag":37,"props":475,"children":476},{},[477],{"type":24,"value":478},"CSS 类名使用 kebab-case",{"type":18,"tag":37,"props":480,"children":481},{},[482],{"type":24,"value":483},"严格按照 Figma 设计稿，CSS 尽量实现像素级对齐，元素间距、色值、字体大小、行高、圆角、阴影必须与设计稿一致（允许 ±1px 误差）",{"type":18,"tag":37,"props":485,"children":486},{},[487],{"type":24,"value":488},"优先使用 CSS 变量管理主题色和间距",{"type":18,"tag":37,"props":490,"children":491},{},[492],{"type":24,"value":493},"图片资源：WebP 优先，SVG 用于图标",{"type":18,"tag":37,"props":495,"children":496},{},[497],{"type":24,"value":498},"禁止内联样式（动态样式除外）",{"type":18,"tag":204,"props":500,"children":502},{"id":501},"_42-nodejs-后端规范",[503],{"type":24,"value":504},"4.2 Node.js 后端规范",{"type":18,"tag":33,"props":506,"children":507},{},[508,513,518,523,528,533,538,543],{"type":18,"tag":37,"props":509,"children":510},{},[511],{"type":24,"value":512},"统一使用 async\u002Fawait，禁止回调地狱",{"type":18,"tag":37,"props":514,"children":515},{},[516],{"type":24,"value":517},"所有路由必须有错误处理中间件兜底",{"type":18,"tag":37,"props":519,"children":520},{},[521],{"type":24,"value":522},"环境变量通过 .env 管理，禁止硬编码敏感信息",{"type":18,"tag":37,"props":524,"children":525},{},[526],{"type":24,"value":527},"接口返回统一格式：{ code, data, message }",{"type":18,"tag":37,"props":529,"children":530},{},[531],{"type":24,"value":532},"接口敏感数据（密码、隐私信息）返回前端前自动脱敏处理",{"type":18,"tag":37,"props":534,"children":535},{},[536],{"type":24,"value":537},"RESTful 方法语义化：GET 查询、POST 创建、PUT 全量更新、PATCH 部分更新、DELETE 删除",{"type":18,"tag":37,"props":539,"children":540},{},[541],{"type":24,"value":542},"HTTP 状态码准确：200 OK、201 Created、204 No Content、400 Bad Request、401 Unauthorized、403 Forbidden、404 Not Found、409 Conflict、500 Internal Error",{"type":18,"tag":37,"props":544,"children":545},{},[546],{"type":24,"value":547},"日志：使用 winston 或 pino，区分 info \u002F warn \u002F error 级别",{"type":18,"tag":19,"props":549,"children":551},{"id":550},"五-git-操作规范",[552],{"type":24,"value":553},"五、 Git 操作规范",{"type":18,"tag":204,"props":555,"children":557},{"id":556},"_51-提交前检查清单",[558],{"type":24,"value":559},"5.1 提交前检查清单",{"type":18,"tag":27,"props":561,"children":562},{},[563,565,571,573,579],{"type":24,"value":564},"执行 ",{"type":18,"tag":139,"props":566,"children":568},{"className":567},[],[569],{"type":24,"value":570},"git commit",{"type":24,"value":572}," \u002F ",{"type":18,"tag":139,"props":574,"children":576},{"className":575},[],[577],{"type":24,"value":578},"git push",{"type":24,"value":580}," \u002F PR 创建前，必须完成：",{"type":18,"tag":105,"props":582,"children":583},{},[584,651,697],{"type":18,"tag":37,"props":585,"children":586},{},[587,592,594],{"type":18,"tag":41,"props":588,"children":589},{},[590],{"type":24,"value":591},"前端额外检查",{"type":24,"value":593},"：\n",{"type":18,"tag":33,"props":595,"children":596},{},[597,608,627,638],{"type":18,"tag":37,"props":598,"children":599},{},[600,606],{"type":18,"tag":139,"props":601,"children":603},{"className":602},[],[604],{"type":24,"value":605},"pnpm lint",{"type":24,"value":607},"（ESLint + Prettier）通过",{"type":18,"tag":37,"props":609,"children":610},{},[611,617,619,625],{"type":18,"tag":139,"props":612,"children":614},{"className":613},[],[615],{"type":24,"value":616},"pnpm type-check",{"type":24,"value":618},"（",{"type":18,"tag":139,"props":620,"children":622},{"className":621},[],[623],{"type":24,"value":624},"tsc --noEmit",{"type":24,"value":626},"）通过",{"type":18,"tag":37,"props":628,"children":629},{},[630,636],{"type":18,"tag":139,"props":631,"children":633},{"className":632},[],[634],{"type":24,"value":635},"pnpm test:unit",{"type":24,"value":637},"（Vitest）通过",{"type":18,"tag":37,"props":639,"children":640},{},[641,643,649],{"type":24,"value":642},"构建产物检查（",{"type":18,"tag":139,"props":644,"children":646},{"className":645},[],[647],{"type":24,"value":648},"pnpm build",{"type":24,"value":650},"），确认无警告",{"type":18,"tag":37,"props":652,"children":653},{},[654,659,660],{"type":18,"tag":41,"props":655,"children":656},{},[657],{"type":24,"value":658},"后端额外检查",{"type":24,"value":593},{"type":18,"tag":33,"props":661,"children":662},{},[663,674,684],{"type":18,"tag":37,"props":664,"children":665},{},[666,672],{"type":18,"tag":139,"props":667,"children":669},{"className":668},[],[670],{"type":24,"value":671},"npm run lint",{"type":24,"value":673}," 通过",{"type":18,"tag":37,"props":675,"children":676},{},[677,683],{"type":18,"tag":139,"props":678,"children":680},{"className":679},[],[681],{"type":24,"value":682},"npm run test",{"type":24,"value":673},{"type":18,"tag":37,"props":685,"children":686},{},[687,689,695],{"type":24,"value":688},"数据库迁移可执行（",{"type":18,"tag":139,"props":690,"children":692},{"className":691},[],[693],{"type":24,"value":694},"npm run migrate:up",{"type":24,"value":696}," 干跑）",{"type":18,"tag":37,"props":698,"children":699},{},[700,705,706],{"type":18,"tag":41,"props":701,"children":702},{},[703],{"type":24,"value":704},"PR 创建规范",{"type":24,"value":593},{"type":18,"tag":33,"props":707,"children":708},{},[709,719],{"type":18,"tag":37,"props":710,"children":711},{},[712,714],{"type":24,"value":713},"必须创建 ",{"type":18,"tag":41,"props":715,"children":716},{},[717],{"type":24,"value":718},"Draft PR",{"type":18,"tag":37,"props":720,"children":721},{},[722],{"type":24,"value":723},"必须设置 Assignees",{"type":18,"tag":204,"props":725,"children":727},{"id":726},"_52-分支模型",[728],{"type":24,"value":729},"5.2 分支模型",{"type":18,"tag":33,"props":731,"children":732},{},[733,759,784,807],{"type":18,"tag":37,"props":734,"children":735},{},[736,741,743,749,751,757],{"type":18,"tag":41,"props":737,"children":738},{},[739],{"type":24,"value":740},"主分支",{"type":24,"value":742},"：",{"type":18,"tag":139,"props":744,"children":746},{"className":745},[],[747],{"type":24,"value":748},"main",{"type":24,"value":750},"（生产）、",{"type":18,"tag":139,"props":752,"children":754},{"className":753},[],[755],{"type":24,"value":756},"develop",{"type":24,"value":758},"（集成）。",{"type":18,"tag":37,"props":760,"children":761},{},[762,767,768,774,776,782],{"type":18,"tag":41,"props":763,"children":764},{},[765],{"type":24,"value":766},"功能分支",{"type":24,"value":742},{"type":18,"tag":139,"props":769,"children":771},{"className":770},[],[772],{"type":24,"value":773},"feature\u002F功能简述-工单号",{"type":24,"value":775},"（如 ",{"type":18,"tag":139,"props":777,"children":779},{"className":778},[],[780],{"type":24,"value":781},"feature\u002Fuser-auth-2847",{"type":24,"value":783},"）。",{"type":18,"tag":37,"props":785,"children":786},{},[787,792,793,799,800,806],{"type":18,"tag":41,"props":788,"children":789},{},[790],{"type":24,"value":791},"修复分支",{"type":24,"value":742},{"type":18,"tag":139,"props":794,"children":796},{"className":795},[],[797],{"type":24,"value":798},"fix\u002F问题简述",{"type":24,"value":775},{"type":18,"tag":139,"props":801,"children":803},{"className":802},[],[804],{"type":24,"value":805},"fix\u002Flogin-redirect-loop",{"type":24,"value":783},{"type":18,"tag":37,"props":808,"children":809},{},[810,815,816,822,823,829],{"type":18,"tag":41,"props":811,"children":812},{},[813],{"type":24,"value":814},"发布分支",{"type":24,"value":742},{"type":18,"tag":139,"props":817,"children":819},{"className":818},[],[820],{"type":24,"value":821},"release\u002F版本号",{"type":24,"value":775},{"type":18,"tag":139,"props":824,"children":826},{"className":825},[],[827],{"type":24,"value":828},"release\u002F2.3.0",{"type":24,"value":783},{"type":18,"tag":204,"props":831,"children":833},{"id":832},"_53-commit-message-规范conventional-commits",[834],{"type":24,"value":835},"5.3 Commit Message 规范（Conventional Commits）",{"type":18,"tag":837,"props":838,"children":840},"pre",{"code":839},"类型(作用域): 简短描述\n\n[可选] 详细说明\n\n[可选] 关联工单：Closes #123\n",[841],{"type":18,"tag":139,"props":842,"children":843},{"__ignoreMap":8},[844],{"type":24,"value":839},{"type":18,"tag":33,"props":846,"children":847},{},[848,921,1012],{"type":18,"tag":37,"props":849,"children":850},{},[851,856,857,863,865,871,873,879,881,887,889,895,897,903,905,911,913,919],{"type":18,"tag":41,"props":852,"children":853},{},[854],{"type":24,"value":855},"类型",{"type":24,"value":742},{"type":18,"tag":139,"props":858,"children":860},{"className":859},[],[861],{"type":24,"value":862},"feat",{"type":24,"value":864},"（功能）、",{"type":18,"tag":139,"props":866,"children":868},{"className":867},[],[869],{"type":24,"value":870},"fix",{"type":24,"value":872},"（修复）、",{"type":18,"tag":139,"props":874,"children":876},{"className":875},[],[877],{"type":24,"value":878},"docs",{"type":24,"value":880},"（文档）、",{"type":18,"tag":139,"props":882,"children":884},{"className":883},[],[885],{"type":24,"value":886},"style",{"type":24,"value":888},"（格式）、",{"type":18,"tag":139,"props":890,"children":892},{"className":891},[],[893],{"type":24,"value":894},"refactor",{"type":24,"value":896},"（重构）、",{"type":18,"tag":139,"props":898,"children":900},{"className":899},[],[901],{"type":24,"value":902},"perf",{"type":24,"value":904},"（性能）、",{"type":18,"tag":139,"props":906,"children":908},{"className":907},[],[909],{"type":24,"value":910},"test",{"type":24,"value":912},"（测试）、",{"type":18,"tag":139,"props":914,"children":916},{"className":915},[],[917],{"type":24,"value":918},"chore",{"type":24,"value":920},"（杂项）。",{"type":18,"tag":37,"props":922,"children":923},{},[924,929,931,937,939,945,946,952,953,959,961,967,968,974,975,981,982,988,990,996,997,1003,1004,1010],{"type":18,"tag":41,"props":925,"children":926},{},[927],{"type":24,"value":928},"作用域",{"type":24,"value":930},"：前端用 ",{"type":18,"tag":139,"props":932,"children":934},{"className":933},[],[935],{"type":24,"value":936},"ui",{"type":24,"value":938},"、",{"type":18,"tag":139,"props":940,"children":942},{"className":941},[],[943],{"type":24,"value":944},"api",{"type":24,"value":938},{"type":18,"tag":139,"props":947,"children":949},{"className":948},[],[950],{"type":24,"value":951},"hooks",{"type":24,"value":938},{"type":18,"tag":139,"props":954,"children":956},{"className":955},[],[957],{"type":24,"value":958},"components",{"type":24,"value":960},"；后端用 ",{"type":18,"tag":139,"props":962,"children":964},{"className":963},[],[965],{"type":24,"value":966},"auth",{"type":24,"value":938},{"type":18,"tag":139,"props":969,"children":971},{"className":970},[],[972],{"type":24,"value":973},"db",{"type":24,"value":938},{"type":18,"tag":139,"props":976,"children":978},{"className":977},[],[979],{"type":24,"value":980},"service",{"type":24,"value":938},{"type":18,"tag":139,"props":983,"children":985},{"className":984},[],[986],{"type":24,"value":987},"middleware",{"type":24,"value":989},"；设计用 ",{"type":18,"tag":139,"props":991,"children":993},{"className":992},[],[994],{"type":24,"value":995},"assets",{"type":24,"value":938},{"type":18,"tag":139,"props":998,"children":1000},{"className":999},[],[1001],{"type":24,"value":1002},"figma",{"type":24,"value":938},{"type":18,"tag":139,"props":1005,"children":1007},{"className":1006},[],[1008],{"type":24,"value":1009},"styles",{"type":24,"value":1011},"。",{"type":18,"tag":37,"props":1013,"children":1014},{},[1015,1020,1021,1027],{"type":18,"tag":41,"props":1016,"children":1017},{},[1018],{"type":24,"value":1019},"禁止在 Commit Message 中添加 AI 署名",{"type":24,"value":775},{"type":18,"tag":139,"props":1022,"children":1024},{"className":1023},[],[1025],{"type":24,"value":1026},"Co-Authored-By: Claude",{"type":24,"value":783},{"type":18,"tag":19,"props":1029,"children":1031},{"id":1030},"六安全与合规",[1032],{"type":24,"value":1033},"六、安全与合规",{"type":18,"tag":33,"props":1035,"children":1036},{},[1037,1047,1089,1144,1168],{"type":18,"tag":37,"props":1038,"children":1039},{},[1040,1045],{"type":18,"tag":41,"props":1041,"children":1042},{},[1043],{"type":24,"value":1044},"绝不提交敏感信息",{"type":24,"value":1046},"：API Key、数据库密码、JWT Secret、私钥等严禁入仓。",{"type":18,"tag":37,"props":1048,"children":1049},{},[1050,1055,1056],{"type":18,"tag":41,"props":1051,"children":1052},{},[1053],{"type":24,"value":1054},"前端安全",{"type":24,"value":593},{"type":18,"tag":33,"props":1057,"children":1058},{},[1059,1064,1077],{"type":18,"tag":37,"props":1060,"children":1061},{},[1062],{"type":24,"value":1063},"所有用户输入必须转义（XSS 防护）。",{"type":18,"tag":37,"props":1065,"children":1066},{},[1067,1069,1075],{"type":24,"value":1068},"使用 ",{"type":18,"tag":139,"props":1070,"children":1072},{"className":1071},[],[1073],{"type":24,"value":1074},"DOMPurify",{"type":24,"value":1076}," 处理富文本渲染。",{"type":18,"tag":37,"props":1078,"children":1079},{},[1080,1082,1088],{"type":24,"value":1081},"CSP（Content Security Policy）头部必须配置，禁止 ",{"type":18,"tag":139,"props":1083,"children":1085},{"className":1084},[],[1086],{"type":24,"value":1087},"unsafe-inline",{"type":24,"value":1011},{"type":18,"tag":37,"props":1090,"children":1091},{},[1092,1097,1098],{"type":18,"tag":41,"props":1093,"children":1094},{},[1095],{"type":24,"value":1096},"后端安全",{"type":24,"value":593},{"type":18,"tag":33,"props":1099,"children":1100},{},[1101,1121,1126,1131],{"type":18,"tag":37,"props":1102,"children":1103},{},[1104,1106,1112,1113,1119],{"type":24,"value":1105},"密码必须使用 ",{"type":18,"tag":139,"props":1107,"children":1109},{"className":1108},[],[1110],{"type":24,"value":1111},"bcrypt",{"type":24,"value":572},{"type":18,"tag":139,"props":1114,"children":1116},{"className":1115},[],[1117],{"type":24,"value":1118},"argon2",{"type":24,"value":1120}," 哈希，禁止 MD5\u002FSHA1。",{"type":18,"tag":37,"props":1122,"children":1123},{},[1124],{"type":24,"value":1125},"JWT 使用 RS256（私钥签名），禁止 HS256（密钥泄露风险）。",{"type":18,"tag":37,"props":1127,"children":1128},{},[1129],{"type":24,"value":1130},"SQL 注入防护：使用 ORM 参数化查询，禁止字符串拼接 SQL。",{"type":18,"tag":37,"props":1132,"children":1133},{},[1134,1136,1142],{"type":24,"value":1135},"NoSQL 注入防护：Mongoose Schema 严格模式，",{"type":18,"tag":139,"props":1137,"children":1139},{"className":1138},[],[1140],{"type":24,"value":1141},"$where",{"type":24,"value":1143}," 禁用。",{"type":18,"tag":37,"props":1145,"children":1146},{},[1147,1152,1154,1160,1161,1167],{"type":18,"tag":41,"props":1148,"children":1149},{},[1150],{"type":24,"value":1151},"文件写入保护",{"type":24,"value":1153},"：编辑\u002F写入文件前，确认目标路径正确，避免覆盖关键配置（如 ",{"type":18,"tag":139,"props":1155,"children":1157},{"className":1156},[],[1158],{"type":24,"value":1159},"vite.config.ts",{"type":24,"value":938},{"type":18,"tag":139,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":24,"value":1166},"docker-compose.yml",{"type":24,"value":783},{"type":18,"tag":37,"props":1169,"children":1170},{},[1171,1176,1178,1184,1185,1191,1192,1198,1199,1205,1206,1212],{"type":18,"tag":41,"props":1172,"children":1173},{},[1174],{"type":24,"value":1175},"Bash 命令审查",{"type":24,"value":1177},"：执行 ",{"type":18,"tag":139,"props":1179,"children":1181},{"className":1180},[],[1182],{"type":24,"value":1183},"rm",{"type":24,"value":938},{"type":18,"tag":139,"props":1186,"children":1188},{"className":1187},[],[1189],{"type":24,"value":1190},"chmod 777",{"type":24,"value":938},{"type":18,"tag":139,"props":1193,"children":1195},{"className":1194},[],[1196],{"type":24,"value":1197},"sudo",{"type":24,"value":938},{"type":18,"tag":139,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":24,"value":1204},"curl | sh",{"type":24,"value":938},{"type":18,"tag":139,"props":1207,"children":1209},{"className":1208},[],[1210],{"type":24,"value":1211},"docker system prune",{"type":24,"value":1213}," 等高风险命令前，必须二次确认。",{"type":18,"tag":19,"props":1215,"children":1217},{"id":1216},"七项目工程化通用约束",[1218],{"type":24,"value":1219},"七、项目工程化通用约束",{"type":18,"tag":105,"props":1221,"children":1222},{},[1223,1236,1241,1246,1251],{"type":18,"tag":37,"props":1224,"children":1225},{},[1226,1228,1234],{"type":24,"value":1227},"版本管理：不随意修改",{"type":18,"tag":139,"props":1229,"children":1231},{"className":1230},[],[1232],{"type":24,"value":1233},".gitignore",{"type":24,"value":1235},"，不提交环境变量、本地配置、日志文件、依赖缓存",{"type":18,"tag":37,"props":1237,"children":1238},{},[1239],{"type":24,"value":1240},"环境区分：严格区分开发环境、测试环境、正式环境配置，环境变量统一管理",{"type":18,"tag":37,"props":1242,"children":1243},{},[1244],{"type":24,"value":1245},"依赖管理：前端不随意安装无用UI库、工具库；后端不引入冗余Node第三方包",{"type":18,"tag":37,"props":1247,"children":1248},{},[1249],{"type":24,"value":1250},"注释规范：复杂业务逻辑、特殊兼容逻辑必须写中文注释，通用简洁逻辑无需多余注释",{"type":18,"tag":37,"props":1252,"children":1253},{},[1254],{"type":24,"value":1255},"兼容适配：前端兼顾主流浏览器、移动端适配；后端接口兼容低版本调用逻辑",{"type":18,"tag":19,"props":1257,"children":1259},{"id":1258},"八禁止行为清单严格执行",[1260],{"type":24,"value":1261},"八、禁止行为清单（严格执行）",{"type":18,"tag":105,"props":1263,"children":1264},{},[1265,1270,1275,1280,1285,1290],{"type":18,"tag":37,"props":1266,"children":1267},{},[1268],{"type":24,"value":1269},"禁止擅自更换项目技术栈、修改项目目录结构",{"type":18,"tag":37,"props":1271,"children":1272},{},[1273],{"type":24,"value":1274},"禁止前端随意改写全局路由、状态管理核心逻辑",{"type":18,"tag":37,"props":1276,"children":1277},{},[1278],{"type":24,"value":1279},"禁止后端随意改动数据库主表结构、删除原有业务字段",{"type":18,"tag":37,"props":1281,"children":1282},{},[1283],{"type":24,"value":1284},"禁止为了简洁省略必要的参数校验、权限判断",{"type":18,"tag":37,"props":1286,"children":1287},{},[1288],{"type":24,"value":1289},"禁止脱离设计稿自由发挥写页面样式与交互",{"type":18,"tag":37,"props":1291,"children":1292},{},[1293],{"type":24,"value":1294},"禁止编写无法维护、无注释、逻辑混乱的一次性后端接口",{"title":8,"searchDepth":1296,"depth":1296,"links":1297},2,[1298,1299,1300,1308,1312,1317,1318,1319],{"id":21,"depth":1296,"text":25},{"id":100,"depth":1296,"text":103},{"id":199,"depth":1296,"text":202,"children":1301},[1302,1304,1305,1306,1307],{"id":206,"depth":1303,"text":209},3,{"id":265,"depth":1303,"text":268},{"id":312,"depth":1303,"text":315},{"id":343,"depth":1303,"text":346},{"id":377,"depth":1303,"text":380},{"id":413,"depth":1296,"text":416,"children":1309},[1310,1311],{"id":419,"depth":1303,"text":422},{"id":501,"depth":1303,"text":504},{"id":550,"depth":1296,"text":553,"children":1313},[1314,1315,1316],{"id":556,"depth":1303,"text":559},{"id":726,"depth":1303,"text":729},{"id":832,"depth":1303,"text":835},{"id":1030,"depth":1296,"text":1033},{"id":1216,"depth":1296,"text":1219},{"id":1258,"depth":1296,"text":1261},"markdown","content:it:001.md","content","it\u002F001.md","it\u002F001","md",{"_path":1327,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":1328,"description":1329,"date":11,"tags":1330,"body":1332,"_type":1320,"_id":4277,"_source":1322,"_file":4278,"_stem":4279,"_extension":1325},"\u002Fit\u002F002","袁进 2026 精讲 Git","渡一名师，Git 精讲",[1331],"Git",{"type":15,"children":1333,"toc":4265},[1334,1339,1367,1372,1429,1434,1439,1521,1528,1561,1578,1583,1652,1787,1792,1797,1809,1822,1828,1840,1845,1850,1855,1872,1877,1882,1890,1909,1917,1991,1999,2049,2058,2088,2093,2385,2390,2413,2418,2423,2449,2454,2492,2497,2502,2510,2544,2557,2645,2650,2655,2668,2676,2681,2689,2694,2699,2707,2726,2734,2833,2841,2931,2939,3037,3045,3126,3131,3139,3161,3294,3331,3336,3347,3355,3368,3373,3379,3390,3396,3404,3449,3462,3470,3478,3491,3496,3504,3525,3533,3538,3543,3556,3561,3738,3743,3752,3760,3765,3804,3809,3895,3900,3909,3917,3922,3937,3965,3973,4005,4010,4015,4044,4053,4066,4105,4110,4182,4187,4205,4211,4216,4224,4229,4242,4247,4260],{"type":18,"tag":19,"props":1335,"children":1337},{"id":1336},"动机",[1338],{"type":24,"value":1336},{"type":18,"tag":33,"props":1340,"children":1341},{},[1342,1347,1352,1357,1362],{"type":18,"tag":37,"props":1343,"children":1344},{},[1345],{"type":24,"value":1346},"不小心把正确的代码删了",{"type":18,"tag":37,"props":1348,"children":1349},{},[1350],{"type":24,"value":1351},"写错了，怎么回到之前的版本",{"type":18,"tag":37,"props":1353,"children":1354},{},[1355],{"type":24,"value":1356},"多个人怎么共同开发同一个项目",{"type":18,"tag":37,"props":1358,"children":1359},{},[1360],{"type":24,"value":1361},"这个功能之前好好的，我到底改了啥",{"type":18,"tag":37,"props":1363,"children":1364},{},[1365],{"type":24,"value":1366},"我想临时实验一个新功能",{"type":18,"tag":19,"props":1368,"children":1370},{"id":1369},"安装",[1371],{"type":24,"value":1369},{"type":18,"tag":33,"props":1373,"children":1374},{},[1375,1395,1411],{"type":18,"tag":37,"props":1376,"children":1377},{},[1378,1383,1385,1393],{"type":18,"tag":41,"props":1379,"children":1380},{},[1381],{"type":24,"value":1382},"windows",{"type":24,"value":1384},"：从官网 ",{"type":18,"tag":1386,"props":1387,"children":1391},"a",{"href":1388,"rel":1389},"https:\u002F\u002Fgit-scm.com\u002Finstall\u002F",[1390],"nofollow",[1392],{"type":24,"value":1388},{"type":24,"value":1394}," 下载安装",{"type":18,"tag":37,"props":1396,"children":1397},{},[1398,1403,1405,1410],{"type":18,"tag":41,"props":1399,"children":1400},{},[1401],{"type":24,"value":1402},"mac",{"type":24,"value":1404},"：自带 git，也可以从官网 ",{"type":18,"tag":1386,"props":1406,"children":1408},{"href":1388,"rel":1407},[1390],[1409],{"type":24,"value":1388},{"type":24,"value":1394},{"type":18,"tag":37,"props":1412,"children":1413},{},[1414,1419,1421,1427],{"type":18,"tag":41,"props":1415,"children":1416},{},[1417],{"type":24,"value":1418},"linux",{"type":24,"value":1420},"：使用命令 ",{"type":18,"tag":139,"props":1422,"children":1424},{"className":1423},[],[1425],{"type":24,"value":1426},"sudo apt-get install git",{"type":24,"value":1428}," 安装",{"type":18,"tag":19,"props":1430,"children":1432},{"id":1431},"配置",[1433],{"type":24,"value":1431},{"type":18,"tag":19,"props":1435,"children":1437},{"id":1436},"配置命令",[1438],{"type":24,"value":1436},{"type":18,"tag":837,"props":1440,"children":1444},{"code":1441,"language":1442,"meta":8,"className":1443,"style":8},"git config -l                   # 查看当前是生效的所有配置\ngit config KEY                  # 查看当前生效的某个具体配置项 KEY 的值\ngit config [--SCOPE] KEY VALUE  # 设置\u002F更新配置项 KEY 的值\n","bash","language-bash shiki shiki-themes github-light",[1445],{"type":18,"tag":139,"props":1446,"children":1447},{"__ignoreMap":8},[1448,1478,1499],{"type":18,"tag":1449,"props":1450,"children":1453},"span",{"class":1451,"line":1452},"line",1,[1454,1460,1466,1472],{"type":18,"tag":1449,"props":1455,"children":1457},{"style":1456},"--shiki-default:#6F42C1",[1458],{"type":24,"value":1459},"git",{"type":18,"tag":1449,"props":1461,"children":1463},{"style":1462},"--shiki-default:#032F62",[1464],{"type":24,"value":1465}," config",{"type":18,"tag":1449,"props":1467,"children":1469},{"style":1468},"--shiki-default:#005CC5",[1470],{"type":24,"value":1471}," -l",{"type":18,"tag":1449,"props":1473,"children":1475},{"style":1474},"--shiki-default:#6A737D",[1476],{"type":24,"value":1477},"                   # 查看当前是生效的所有配置\n",{"type":18,"tag":1449,"props":1479,"children":1480},{"class":1451,"line":1296},[1481,1485,1489,1494],{"type":18,"tag":1449,"props":1482,"children":1483},{"style":1456},[1484],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1486,"children":1487},{"style":1462},[1488],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1490,"children":1491},{"style":1462},[1492],{"type":24,"value":1493}," KEY",{"type":18,"tag":1449,"props":1495,"children":1496},{"style":1474},[1497],{"type":24,"value":1498},"                  # 查看当前生效的某个具体配置项 KEY 的值\n",{"type":18,"tag":1449,"props":1500,"children":1501},{"class":1451,"line":1303},[1502,1506,1510,1516],{"type":18,"tag":1449,"props":1503,"children":1504},{"style":1456},[1505],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1507,"children":1508},{"style":1462},[1509],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1511,"children":1513},{"style":1512},"--shiki-default:#24292E",[1514],{"type":24,"value":1515}," [--SCOPE] KEY VALUE  ",{"type":18,"tag":1449,"props":1517,"children":1518},{"style":1474},[1519],{"type":24,"value":1520},"# 设置\u002F更新配置项 KEY 的值\n",{"type":18,"tag":1522,"props":1523,"children":1525},"h4",{"id":1524},"配置范围-scope",[1526],{"type":24,"value":1527},"配置范围 SCOPE",{"type":18,"tag":33,"props":1529,"children":1530},{},[1531,1536,1546,1556],{"type":18,"tag":37,"props":1532,"children":1533},{},[1534],{"type":24,"value":1535},"worktree：仅对当前工作树生效",{"type":18,"tag":37,"props":1537,"children":1538},{},[1539,1544],{"type":18,"tag":41,"props":1540,"children":1541},{},[1542],{"type":24,"value":1543},"local",{"type":24,"value":1545},"：【常见】【默认】仅对当前仓库有效",{"type":18,"tag":37,"props":1547,"children":1548},{},[1549,1554],{"type":18,"tag":41,"props":1550,"children":1551},{},[1552],{"type":24,"value":1553},"global",{"type":24,"value":1555},"：【常见】对当前用户的所有仓库有效",{"type":18,"tag":37,"props":1557,"children":1558},{},[1559],{"type":24,"value":1560},"system：对所有用户有效",{"type":18,"tag":27,"props":1562,"children":1563},{},[1564,1566,1570,1572,1576],{"type":24,"value":1565},"优先级从到到低：worktree > ",{"type":18,"tag":41,"props":1567,"children":1568},{},[1569],{"type":24,"value":1543},{"type":24,"value":1571}," > ",{"type":18,"tag":41,"props":1573,"children":1574},{},[1575],{"type":24,"value":1553},{"type":24,"value":1577}," > system",{"type":18,"tag":1522,"props":1579,"children":1581},{"id":1580},"常见配置",[1582],{"type":24,"value":1580},{"type":18,"tag":33,"props":1584,"children":1585},{},[1586,1596,1606,1614,1624,1642],{"type":18,"tag":37,"props":1587,"children":1588},{},[1589,1594],{"type":18,"tag":41,"props":1590,"children":1591},{},[1592],{"type":24,"value":1593},"user.name",{"type":24,"value":1595},"：【必配】配置用户名。后续提交会使用该用户名",{"type":18,"tag":37,"props":1597,"children":1598},{},[1599,1604],{"type":18,"tag":41,"props":1600,"children":1601},{},[1602],{"type":24,"value":1603},"user.email",{"type":24,"value":1605},"：【必配】配置邮箱。后续提交会使用该邮箱",{"type":18,"tag":37,"props":1607,"children":1608},{},[1609,1613],{"type":18,"tag":41,"props":1610,"children":1611},{},[1612],{"type":24,"value":1593},{"type":24,"value":1595},{"type":18,"tag":37,"props":1615,"children":1616},{},[1617,1622],{"type":18,"tag":41,"props":1618,"children":1619},{},[1620],{"type":24,"value":1621},"core.editor",{"type":24,"value":1623},"：配置默认的文本编辑器",{"type":18,"tag":37,"props":1625,"children":1626},{},[1627,1632,1634,1640],{"type":18,"tag":41,"props":1628,"children":1629},{},[1630],{"type":24,"value":1631},"core.ignorecase",{"type":24,"value":1633},"：配置是否忽略文件名的大小写，默认是 ",{"type":18,"tag":139,"props":1635,"children":1637},{"className":1636},[],[1638],{"type":24,"value":1639},"true",{"type":24,"value":1641},"，即忽略大小写",{"type":18,"tag":37,"props":1643,"children":1644},{},[1645,1650],{"type":18,"tag":41,"props":1646,"children":1647},{},[1648],{"type":24,"value":1649},"init.defaultbranch",{"type":24,"value":1651},"：配置初始化后的默认分支名",{"type":18,"tag":837,"props":1653,"children":1655},{"code":1654,"language":1442,"meta":8,"className":1443,"style":8},"git config --global user.name \"wangchong1118\"\ngit config --global user.email \"wangchong1118@126.com\"\ngit config --global core.editor \"code\"\ngit config --global core.ignorecase false\ngit config --global init.defaultbranch \"main\"\n",[1656],{"type":18,"tag":139,"props":1657,"children":1658},{"__ignoreMap":8},[1659,1685,1710,1735,1761],{"type":18,"tag":1449,"props":1660,"children":1661},{"class":1451,"line":1452},[1662,1666,1670,1675,1680],{"type":18,"tag":1449,"props":1663,"children":1664},{"style":1456},[1665],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1667,"children":1668},{"style":1462},[1669],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1671,"children":1672},{"style":1468},[1673],{"type":24,"value":1674}," --global",{"type":18,"tag":1449,"props":1676,"children":1677},{"style":1462},[1678],{"type":24,"value":1679}," user.name",{"type":18,"tag":1449,"props":1681,"children":1682},{"style":1462},[1683],{"type":24,"value":1684}," \"wangchong1118\"\n",{"type":18,"tag":1449,"props":1686,"children":1687},{"class":1451,"line":1296},[1688,1692,1696,1700,1705],{"type":18,"tag":1449,"props":1689,"children":1690},{"style":1456},[1691],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1693,"children":1694},{"style":1462},[1695],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1697,"children":1698},{"style":1468},[1699],{"type":24,"value":1674},{"type":18,"tag":1449,"props":1701,"children":1702},{"style":1462},[1703],{"type":24,"value":1704}," user.email",{"type":18,"tag":1449,"props":1706,"children":1707},{"style":1462},[1708],{"type":24,"value":1709}," \"wangchong1118@126.com\"\n",{"type":18,"tag":1449,"props":1711,"children":1712},{"class":1451,"line":1303},[1713,1717,1721,1725,1730],{"type":18,"tag":1449,"props":1714,"children":1715},{"style":1456},[1716],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1718,"children":1719},{"style":1462},[1720],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1722,"children":1723},{"style":1468},[1724],{"type":24,"value":1674},{"type":18,"tag":1449,"props":1726,"children":1727},{"style":1462},[1728],{"type":24,"value":1729}," core.editor",{"type":18,"tag":1449,"props":1731,"children":1732},{"style":1462},[1733],{"type":24,"value":1734}," \"code\"\n",{"type":18,"tag":1449,"props":1736,"children":1738},{"class":1451,"line":1737},4,[1739,1743,1747,1751,1756],{"type":18,"tag":1449,"props":1740,"children":1741},{"style":1456},[1742],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1744,"children":1745},{"style":1462},[1746],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1748,"children":1749},{"style":1468},[1750],{"type":24,"value":1674},{"type":18,"tag":1449,"props":1752,"children":1753},{"style":1462},[1754],{"type":24,"value":1755}," core.ignorecase",{"type":18,"tag":1449,"props":1757,"children":1758},{"style":1468},[1759],{"type":24,"value":1760}," false\n",{"type":18,"tag":1449,"props":1762,"children":1764},{"class":1451,"line":1763},5,[1765,1769,1773,1777,1782],{"type":18,"tag":1449,"props":1766,"children":1767},{"style":1456},[1768],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1770,"children":1771},{"style":1462},[1772],{"type":24,"value":1465},{"type":18,"tag":1449,"props":1774,"children":1775},{"style":1468},[1776],{"type":24,"value":1674},{"type":18,"tag":1449,"props":1778,"children":1779},{"style":1462},[1780],{"type":24,"value":1781}," init.defaultbranch",{"type":18,"tag":1449,"props":1783,"children":1784},{"style":1462},[1785],{"type":24,"value":1786}," \"main\"\n",{"type":18,"tag":19,"props":1788,"children":1790},{"id":1789},"初始化",[1791],{"type":24,"value":1789},{"type":18,"tag":27,"props":1793,"children":1794},{},[1795],{"type":24,"value":1796},"要对一个目录使用 git 进行版本管理，必须先将该目录设置为 git 仓库",{"type":18,"tag":27,"props":1798,"children":1799},{},[1800,1801,1807],{"type":24,"value":1068},{"type":18,"tag":139,"props":1802,"children":1804},{"className":1803},[],[1805],{"type":24,"value":1806},"git init",{"type":24,"value":1808}," 命令初始化一个新的 git 仓库",{"type":18,"tag":27,"props":1810,"children":1811},{},[1812,1814,1820],{"type":24,"value":1813},"该命令会在当前目录下创建一个 ",{"type":18,"tag":139,"props":1815,"children":1817},{"className":1816},[],[1818],{"type":24,"value":1819},".git",{"type":24,"value":1821}," 目录，该目录就是 git 仓库，里面记录了仓库的所有信息。该目录不可删除，一旦删除，该仓库就不存在了",{"type":18,"tag":19,"props":1823,"children":1825},{"id":1824},"项目忽略文件-gitignore",[1826],{"type":24,"value":1827},"项目忽略文件 .gitignore",{"type":18,"tag":27,"props":1829,"children":1830},{},[1831,1833,1838],{"type":24,"value":1832},"仓库中某些文件是「个人专属」不需要的文件排除，不会在团队间共享，可以使用 ",{"type":18,"tag":139,"props":1834,"children":1836},{"className":1835},[],[1837],{"type":24,"value":1233},{"type":24,"value":1839}," 文件将不需要的文件在提交仓库是自动排除掉",{"type":18,"tag":19,"props":1841,"children":1843},{"id":1842},"提交",[1844],{"type":24,"value":1842},{"type":18,"tag":27,"props":1846,"children":1847},{},[1848],{"type":24,"value":1849},"每一次提交就相当于将当前目录下的所有文件进行「拍照」，「照片」会保存在 git 仓库中",{"type":18,"tag":27,"props":1851,"children":1852},{},[1853],{"type":24,"value":1854},"「拍照」的主要目的，是为了将来可以在不同的「照片」之间进行比较和恢复",{"type":18,"tag":1856,"props":1857,"children":1858},"blockquote",{},[1859],{"type":18,"tag":27,"props":1860,"children":1861},{},[1862,1864,1870],{"type":24,"value":1863},"「照片」的具体位置在 ",{"type":18,"tag":139,"props":1865,"children":1867},{"className":1866},[],[1868],{"type":24,"value":1869},".git\u002Fobjects",{"type":24,"value":1871}," 的目录下",{"type":18,"tag":1522,"props":1873,"children":1875},{"id":1874},"如何提交",[1876],{"type":24,"value":1874},{"type":18,"tag":27,"props":1878,"children":1879},{},[1880],{"type":24,"value":1881},"提交分为两步：",{"type":18,"tag":105,"props":1883,"children":1884},{},[1885],{"type":18,"tag":37,"props":1886,"children":1887},{},[1888],{"type":24,"value":1889},"【可选】查看当前 git 状态",{"type":18,"tag":837,"props":1891,"children":1893},{"code":1892,"language":1442,"meta":8,"className":1443,"style":8},"git status\n",[1894],{"type":18,"tag":139,"props":1895,"children":1896},{"__ignoreMap":8},[1897],{"type":18,"tag":1449,"props":1898,"children":1899},{"class":1451,"line":1452},[1900,1904],{"type":18,"tag":1449,"props":1901,"children":1902},{"style":1456},[1903],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1905,"children":1906},{"style":1462},[1907],{"type":24,"value":1908}," status\n",{"type":18,"tag":105,"props":1910,"children":1911},{"start":1296},[1912],{"type":18,"tag":37,"props":1913,"children":1914},{},[1915],{"type":24,"value":1916},"将更新的文件暂存起来",{"type":18,"tag":837,"props":1918,"children":1920},{"code":1919,"language":1442,"meta":8,"className":1443,"style":8},"git add \u003Cfile1> \u003Cfile2>     # 暂存指定的文件\ngit add .                   # 暂存当前项目目录及子目录下的所有文件\n",[1921],{"type":18,"tag":139,"props":1922,"children":1923},{"__ignoreMap":8},[1924,1970],{"type":18,"tag":1449,"props":1925,"children":1926},{"class":1451,"line":1452},[1927,1931,1936,1942,1947,1952,1956,1960,1965],{"type":18,"tag":1449,"props":1928,"children":1929},{"style":1456},[1930],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1932,"children":1933},{"style":1462},[1934],{"type":24,"value":1935}," add",{"type":18,"tag":1449,"props":1937,"children":1939},{"style":1938},"--shiki-default:#D73A49",[1940],{"type":24,"value":1941}," \u003C",{"type":18,"tag":1449,"props":1943,"children":1944},{"style":1462},[1945],{"type":24,"value":1946},"file",{"type":18,"tag":1449,"props":1948,"children":1949},{"style":1938},[1950],{"type":24,"value":1951},"1>",{"type":18,"tag":1449,"props":1953,"children":1954},{"style":1938},[1955],{"type":24,"value":1941},{"type":18,"tag":1449,"props":1957,"children":1958},{"style":1462},[1959],{"type":24,"value":1946},{"type":18,"tag":1449,"props":1961,"children":1962},{"style":1938},[1963],{"type":24,"value":1964},"2>",{"type":18,"tag":1449,"props":1966,"children":1967},{"style":1474},[1968],{"type":24,"value":1969},"     # 暂存指定的文件\n",{"type":18,"tag":1449,"props":1971,"children":1972},{"class":1451,"line":1296},[1973,1977,1981,1986],{"type":18,"tag":1449,"props":1974,"children":1975},{"style":1456},[1976],{"type":24,"value":1459},{"type":18,"tag":1449,"props":1978,"children":1979},{"style":1462},[1980],{"type":24,"value":1935},{"type":18,"tag":1449,"props":1982,"children":1983},{"style":1462},[1984],{"type":24,"value":1985}," .",{"type":18,"tag":1449,"props":1987,"children":1988},{"style":1474},[1989],{"type":24,"value":1990},"                   # 暂存当前项目目录及子目录下的所有文件\n",{"type":18,"tag":105,"props":1992,"children":1993},{"start":1303},[1994],{"type":18,"tag":37,"props":1995,"children":1996},{},[1997],{"type":24,"value":1998},"将暂存的内容一起提交",{"type":18,"tag":837,"props":2000,"children":2002},{"code":2001,"language":1442,"meta":8,"className":1443,"style":8},"git commit # 会自动打开默认的文本编辑器，在编辑器中编写提交信息，保存后自动完成提交\ngit commit -m \"提交信息\"        # 直接在命令行中直接编写提交信息，直接完成提交，不打开文本编辑器\n",[2003],{"type":18,"tag":139,"props":2004,"children":2005},{"__ignoreMap":8},[2006,2023],{"type":18,"tag":1449,"props":2007,"children":2008},{"class":1451,"line":1452},[2009,2013,2018],{"type":18,"tag":1449,"props":2010,"children":2011},{"style":1456},[2012],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2014,"children":2015},{"style":1462},[2016],{"type":24,"value":2017}," commit",{"type":18,"tag":1449,"props":2019,"children":2020},{"style":1474},[2021],{"type":24,"value":2022}," # 会自动打开默认的文本编辑器，在编辑器中编写提交信息，保存后自动完成提交\n",{"type":18,"tag":1449,"props":2024,"children":2025},{"class":1451,"line":1296},[2026,2030,2034,2039,2044],{"type":18,"tag":1449,"props":2027,"children":2028},{"style":1456},[2029],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2031,"children":2032},{"style":1462},[2033],{"type":24,"value":2017},{"type":18,"tag":1449,"props":2035,"children":2036},{"style":1468},[2037],{"type":24,"value":2038}," -m",{"type":18,"tag":1449,"props":2040,"children":2041},{"style":1462},[2042],{"type":24,"value":2043}," \"提交信息\"",{"type":18,"tag":1449,"props":2045,"children":2046},{"style":1474},[2047],{"type":24,"value":2048},"        # 直接在命令行中直接编写提交信息，直接完成提交，不打开文本编辑器\n",{"type":18,"tag":27,"props":2050,"children":2051},{},[2052,2057],{"type":18,"tag":41,"props":2053,"children":2054},{},[2055],{"type":24,"value":2056},"术语",{"type":24,"value":742},{"type":18,"tag":33,"props":2059,"children":2060},{},[2061,2071],{"type":18,"tag":37,"props":2062,"children":2063},{},[2064,2069],{"type":18,"tag":41,"props":2065,"children":2066},{},[2067],{"type":24,"value":2068},"工作区",{"type":24,"value":2070},"：真实的工作文件",{"type":18,"tag":37,"props":2072,"children":2073},{},[2074,2079,2080,2086],{"type":18,"tag":41,"props":2075,"children":2076},{},[2077],{"type":24,"value":2078},"暂存区",{"type":24,"value":742},{"type":18,"tag":139,"props":2081,"children":2083},{"className":2082},[],[2084],{"type":24,"value":2085},"git add",{"type":24,"value":2087}," 命令暂存起来的文件",{"type":18,"tag":1522,"props":2089,"children":2091},{"id":2090},"提交信息编写规范",[2092],{"type":24,"value":2090},{"type":18,"tag":2094,"props":2095,"children":2096},"table",{},[2097,2126],{"type":18,"tag":2098,"props":2099,"children":2100},"thead",{},[2101],{"type":18,"tag":2102,"props":2103,"children":2104},"tr",{},[2105,2111,2116,2121],{"type":18,"tag":2106,"props":2107,"children":2108},"th",{},[2109],{"type":24,"value":2110},"提交类型",{"type":18,"tag":2106,"props":2112,"children":2113},{},[2114],{"type":24,"value":2115},"标识符",{"type":18,"tag":2106,"props":2117,"children":2118},{},[2119],{"type":24,"value":2120},"说明",{"type":18,"tag":2106,"props":2122,"children":2123},{},[2124],{"type":24,"value":2125},"示例",{"type":18,"tag":2127,"props":2128,"children":2129},"tbody",{},[2130,2156,2181,2206,2228,2250,2272,2294,2317,2340,2362],{"type":18,"tag":2102,"props":2131,"children":2132},{},[2133,2142,2146,2151],{"type":18,"tag":2134,"props":2135,"children":2136},"td",{},[2137],{"type":18,"tag":41,"props":2138,"children":2139},{},[2140],{"type":24,"value":2141},"功能新增",{"type":18,"tag":2134,"props":2143,"children":2144},{},[2145],{"type":24,"value":862},{"type":18,"tag":2134,"props":2147,"children":2148},{},[2149],{"type":24,"value":2150},"新增功能或特性",{"type":18,"tag":2134,"props":2152,"children":2153},{},[2154],{"type":24,"value":2155},"feat: 添加用户登录功能",{"type":18,"tag":2102,"props":2157,"children":2158},{},[2159,2167,2171,2176],{"type":18,"tag":2134,"props":2160,"children":2161},{},[2162],{"type":18,"tag":41,"props":2163,"children":2164},{},[2165],{"type":24,"value":2166},"问题修复",{"type":18,"tag":2134,"props":2168,"children":2169},{},[2170],{"type":24,"value":870},{"type":18,"tag":2134,"props":2172,"children":2173},{},[2174],{"type":24,"value":2175},"修复bug或问题",{"type":18,"tag":2134,"props":2177,"children":2178},{},[2179],{"type":24,"value":2180},"fix: 修复登录超时问题",{"type":18,"tag":2102,"props":2182,"children":2183},{},[2184,2192,2196,2201],{"type":18,"tag":2134,"props":2185,"children":2186},{},[2187],{"type":18,"tag":41,"props":2188,"children":2189},{},[2190],{"type":24,"value":2191},"文档更新",{"type":18,"tag":2134,"props":2193,"children":2194},{},[2195],{"type":24,"value":878},{"type":18,"tag":2134,"props":2197,"children":2198},{},[2199],{"type":24,"value":2200},"仅文档变更",{"type":18,"tag":2134,"props":2202,"children":2203},{},[2204],{"type":24,"value":2205},"docs: 更新API使用说明",{"type":18,"tag":2102,"props":2207,"children":2208},{},[2209,2214,2218,2223],{"type":18,"tag":2134,"props":2210,"children":2211},{},[2212],{"type":24,"value":2213},"代码风格",{"type":18,"tag":2134,"props":2215,"children":2216},{},[2217],{"type":24,"value":886},{"type":18,"tag":2134,"props":2219,"children":2220},{},[2221],{"type":24,"value":2222},"代码格式调整(不影响功能)",{"type":18,"tag":2134,"props":2224,"children":2225},{},[2226],{"type":24,"value":2227},"style:调整代码缩进格式",{"type":18,"tag":2102,"props":2229,"children":2230},{},[2231,2236,2240,2245],{"type":18,"tag":2134,"props":2232,"children":2233},{},[2234],{"type":24,"value":2235},"代码重构",{"type":18,"tag":2134,"props":2237,"children":2238},{},[2239],{"type":24,"value":894},{"type":18,"tag":2134,"props":2241,"children":2242},{},[2243],{"type":24,"value":2244},"代码重构（非功能变更）",{"type":18,"tag":2134,"props":2246,"children":2247},{},[2248],{"type":24,"value":2249},"refactor: 重构用户认证模块",{"type":18,"tag":2102,"props":2251,"children":2252},{},[2253,2258,2262,2267],{"type":18,"tag":2134,"props":2254,"children":2255},{},[2256],{"type":24,"value":2257},"性能优化",{"type":18,"tag":2134,"props":2259,"children":2260},{},[2261],{"type":24,"value":902},{"type":18,"tag":2134,"props":2263,"children":2264},{},[2265],{"type":24,"value":2266},"性能优化相关",{"type":18,"tag":2134,"props":2268,"children":2269},{},[2270],{"type":24,"value":2271},"perf: 优化数据库查询性能",{"type":18,"tag":2102,"props":2273,"children":2274},{},[2275,2280,2284,2289],{"type":18,"tag":2134,"props":2276,"children":2277},{},[2278],{"type":24,"value":2279},"测试相关",{"type":18,"tag":2134,"props":2281,"children":2282},{},[2283],{"type":24,"value":910},{"type":18,"tag":2134,"props":2285,"children":2286},{},[2287],{"type":24,"value":2288},"测试用例相关",{"type":18,"tag":2134,"props":2290,"children":2291},{},[2292],{"type":24,"value":2293},"test：添加登录功能单元测试",{"type":18,"tag":2102,"props":2295,"children":2296},{},[2297,2302,2307,2312],{"type":18,"tag":2134,"props":2298,"children":2299},{},[2300],{"type":24,"value":2301},"构建系统",{"type":18,"tag":2134,"props":2303,"children":2304},{},[2305],{"type":24,"value":2306},"build",{"type":18,"tag":2134,"props":2308,"children":2309},{},[2310],{"type":24,"value":2311},"构建系统或外部依赖变更",{"type":18,"tag":2134,"props":2313,"children":2314},{},[2315],{"type":24,"value":2316},"build: 更新 webpack 配置",{"type":18,"tag":2102,"props":2318,"children":2319},{},[2320,2325,2330,2335],{"type":18,"tag":2134,"props":2321,"children":2322},{},[2323],{"type":24,"value":2324},"持续集成",{"type":18,"tag":2134,"props":2326,"children":2327},{},[2328],{"type":24,"value":2329},"ci",{"type":18,"tag":2134,"props":2331,"children":2332},{},[2333],{"type":24,"value":2334},"CI\u002FCD配置变更",{"type":18,"tag":2134,"props":2336,"children":2337},{},[2338],{"type":24,"value":2339},"ci: 添加 GitHub Actions 工作流",{"type":18,"tag":2102,"props":2341,"children":2342},{},[2343,2348,2352,2357],{"type":18,"tag":2134,"props":2344,"children":2345},{},[2346],{"type":24,"value":2347},"工具变更",{"type":18,"tag":2134,"props":2349,"children":2350},{},[2351],{"type":24,"value":918},{"type":18,"tag":2134,"props":2353,"children":2354},{},[2355],{"type":24,"value":2356},"构建过程或辅助工具变更",{"type":18,"tag":2134,"props":2358,"children":2359},{},[2360],{"type":24,"value":2361},"chore: 更新依赖包版本",{"type":18,"tag":2102,"props":2363,"children":2364},{},[2365,2370,2375,2380],{"type":18,"tag":2134,"props":2366,"children":2367},{},[2368],{"type":24,"value":2369},"回滚操作",{"type":18,"tag":2134,"props":2371,"children":2372},{},[2373],{"type":24,"value":2374},"revert",{"type":18,"tag":2134,"props":2376,"children":2377},{},[2378],{"type":24,"value":2379},"回滚之前的提交",{"type":18,"tag":2134,"props":2381,"children":2382},{},[2383],{"type":24,"value":2384},"revert: 回滚错误的合并提交",{"type":18,"tag":1522,"props":2386,"children":2388},{"id":2387},"提交信息修改",[2389],{"type":24,"value":2387},{"type":18,"tag":837,"props":2391,"children":2393},{"code":2392,"language":1442,"meta":8,"className":1443,"style":8},"git commit -amend\n",[2394],{"type":18,"tag":139,"props":2395,"children":2396},{"__ignoreMap":8},[2397],{"type":18,"tag":1449,"props":2398,"children":2399},{"class":1451,"line":1452},[2400,2404,2408],{"type":18,"tag":1449,"props":2401,"children":2402},{"style":1456},[2403],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2405,"children":2406},{"style":1462},[2407],{"type":24,"value":2017},{"type":18,"tag":1449,"props":2409,"children":2410},{"style":1468},[2411],{"type":24,"value":2412}," -amend\n",{"type":18,"tag":27,"props":2414,"children":2415},{},[2416],{"type":24,"value":2417},"该命令通常用于修改最新的提交消息",{"type":18,"tag":27,"props":2419,"children":2420},{},[2421],{"type":24,"value":2422},"所以使用该命令时，要确保自己所在的位置在最新的位置",{"type":18,"tag":1856,"props":2424,"children":2425},{},[2426,2431,2444],{"type":18,"tag":27,"props":2427,"children":2428},{},[2429],{"type":24,"value":2430},"最佳实践 1：",{"type":18,"tag":105,"props":2432,"children":2433},{},[2434,2439],{"type":18,"tag":37,"props":2435,"children":2436},{},[2437],{"type":24,"value":2438},"编与提交消息时，尽量不要犯错",{"type":18,"tag":37,"props":2440,"children":2441},{},[2442],{"type":24,"value":2443},"提交后，立即审核提交消息，发现消息错误，立即通过上面的命令修复",{"type":18,"tag":27,"props":2445,"children":2446},{},[2447],{"type":24,"value":2448},"最佳实践 2：让 AI 编写提交消息，审核后发布",{"type":18,"tag":1522,"props":2450,"children":2452},{"id":2451},"回滚某个提交",[2453],{"type":24,"value":2451},{"type":18,"tag":837,"props":2455,"children":2457},{"code":2456,"language":1442,"meta":8,"className":1443,"style":8},"git restore --source COMMIT_ID .    # 将指定的提交覆盖到当前项目工作区\n",[2458],{"type":18,"tag":139,"props":2459,"children":2460},{"__ignoreMap":8},[2461],{"type":18,"tag":1449,"props":2462,"children":2463},{"class":1451,"line":1452},[2464,2468,2473,2478,2483,2487],{"type":18,"tag":1449,"props":2465,"children":2466},{"style":1456},[2467],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2469,"children":2470},{"style":1462},[2471],{"type":24,"value":2472}," restore",{"type":18,"tag":1449,"props":2474,"children":2475},{"style":1468},[2476],{"type":24,"value":2477}," --source",{"type":18,"tag":1449,"props":2479,"children":2480},{"style":1462},[2481],{"type":24,"value":2482}," COMMIT_ID",{"type":18,"tag":1449,"props":2484,"children":2485},{"style":1462},[2486],{"type":24,"value":1985},{"type":18,"tag":1449,"props":2488,"children":2489},{"style":1474},[2490],{"type":24,"value":2491},"    # 将指定的提交覆盖到当前项目工作区\n",{"type":18,"tag":27,"props":2493,"children":2494},{},[2495],{"type":24,"value":2496},"使用上述命令时，要确保工作区干净（暂存区没东西，工作区无更改）",{"type":18,"tag":27,"props":2498,"children":2499},{},[2500],{"type":24,"value":2501},"工作区如果不干净怎么办？（暂存区没东西或者工作区有更改）",{"type":18,"tag":105,"props":2503,"children":2504},{},[2505],{"type":18,"tag":37,"props":2506,"children":2507},{},[2508],{"type":24,"value":2509},"先把目前状态保存到存储库",{"type":18,"tag":837,"props":2511,"children":2513},{"code":2512,"language":1442,"meta":8,"className":1443,"style":8},"git stash push -u -a\n",[2514],{"type":18,"tag":139,"props":2515,"children":2516},{"__ignoreMap":8},[2517],{"type":18,"tag":1449,"props":2518,"children":2519},{"class":1451,"line":1452},[2520,2524,2529,2534,2539],{"type":18,"tag":1449,"props":2521,"children":2522},{"style":1456},[2523],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2525,"children":2526},{"style":1462},[2527],{"type":24,"value":2528}," stash",{"type":18,"tag":1449,"props":2530,"children":2531},{"style":1462},[2532],{"type":24,"value":2533}," push",{"type":18,"tag":1449,"props":2535,"children":2536},{"style":1468},[2537],{"type":24,"value":2538}," -u",{"type":18,"tag":1449,"props":2540,"children":2541},{"style":1468},[2542],{"type":24,"value":2543}," -a\n",{"type":18,"tag":105,"props":2545,"children":2546},{"start":1296},[2547,2552],{"type":18,"tag":37,"props":2548,"children":2549},{},[2550],{"type":24,"value":2551},"工作区干净了，就可以做任何其他的事情",{"type":18,"tag":37,"props":2553,"children":2554},{},[2555],{"type":24,"value":2556},"如果要恢复工作区",{"type":18,"tag":837,"props":2558,"children":2560},{"code":2559,"language":1442,"meta":8,"className":1443,"style":8},"git stash list  # 【可选】列出所有的存储\ngit stash pop   # 恢复上一次的存储，同时删除上一次的存储\ngit stash pop \u003CSTASH_ID> # 恢复到指定ID的存储，同时删除该存储\n",[2561],{"type":18,"tag":139,"props":2562,"children":2563},{"__ignoreMap":8},[2564,2585,2606],{"type":18,"tag":1449,"props":2565,"children":2566},{"class":1451,"line":1452},[2567,2571,2575,2580],{"type":18,"tag":1449,"props":2568,"children":2569},{"style":1456},[2570],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2572,"children":2573},{"style":1462},[2574],{"type":24,"value":2528},{"type":18,"tag":1449,"props":2576,"children":2577},{"style":1462},[2578],{"type":24,"value":2579}," list",{"type":18,"tag":1449,"props":2581,"children":2582},{"style":1474},[2583],{"type":24,"value":2584},"  # 【可选】列出所有的存储\n",{"type":18,"tag":1449,"props":2586,"children":2587},{"class":1451,"line":1296},[2588,2592,2596,2601],{"type":18,"tag":1449,"props":2589,"children":2590},{"style":1456},[2591],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2593,"children":2594},{"style":1462},[2595],{"type":24,"value":2528},{"type":18,"tag":1449,"props":2597,"children":2598},{"style":1462},[2599],{"type":24,"value":2600}," pop",{"type":18,"tag":1449,"props":2602,"children":2603},{"style":1474},[2604],{"type":24,"value":2605},"   # 恢复上一次的存储，同时删除上一次的存储\n",{"type":18,"tag":1449,"props":2607,"children":2608},{"class":1451,"line":1303},[2609,2613,2617,2621,2625,2630,2635,2640],{"type":18,"tag":1449,"props":2610,"children":2611},{"style":1456},[2612],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2614,"children":2615},{"style":1462},[2616],{"type":24,"value":2528},{"type":18,"tag":1449,"props":2618,"children":2619},{"style":1462},[2620],{"type":24,"value":2600},{"type":18,"tag":1449,"props":2622,"children":2623},{"style":1938},[2624],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2626,"children":2627},{"style":1462},[2628],{"type":24,"value":2629},"STASH_I",{"type":18,"tag":1449,"props":2631,"children":2632},{"style":1512},[2633],{"type":24,"value":2634},"D",{"type":18,"tag":1449,"props":2636,"children":2637},{"style":1938},[2638],{"type":24,"value":2639},">",{"type":18,"tag":1449,"props":2641,"children":2642},{"style":1474},[2643],{"type":24,"value":2644}," # 恢复到指定ID的存储，同时删除该存储\n",{"type":18,"tag":19,"props":2646,"children":2648},{"id":2647},"分支",[2649],{"type":24,"value":2647},{"type":18,"tag":27,"props":2651,"children":2652},{},[2653],{"type":24,"value":2654},"牢记一下两点：",{"type":18,"tag":33,"props":2656,"children":2657},{},[2658,2663],{"type":18,"tag":37,"props":2659,"children":2660},{},[2661],{"type":24,"value":2662},"分支是一个指针，指向一个快照",{"type":18,"tag":37,"props":2664,"children":2665},{},[2666],{"type":24,"value":2667},"HEAD 是一个指针，指向一个分支",{"type":18,"tag":837,"props":2669,"children":2671},{"code":2670},"提交 1 --> 提交 2 --> 提交 3\n\n分支 1 --> 提交 3\nHEAD --> 分支 1\n",[2672],{"type":18,"tag":139,"props":2673,"children":2674},{"__ignoreMap":8},[2675],{"type":24,"value":2670},{"type":18,"tag":27,"props":2677,"children":2678},{},[2679],{"type":24,"value":2680},"简化后",{"type":18,"tag":837,"props":2682,"children":2684},{"code":2683},"提交 1 --> 提交 2 --> 提交 3 (*分支 1)\n",[2685],{"type":18,"tag":139,"props":2686,"children":2687},{"__ignoreMap":8},[2688],{"type":24,"value":2683},{"type":18,"tag":1522,"props":2690,"children":2692},{"id":2691},"分支管理",[2693],{"type":24,"value":2691},{"type":18,"tag":27,"props":2695,"children":2696},{},[2697],{"type":24,"value":2698},"分支基本操作：",{"type":18,"tag":105,"props":2700,"children":2701},{},[2702],{"type":18,"tag":37,"props":2703,"children":2704},{},[2705],{"type":24,"value":2706},"查看分支",{"type":18,"tag":837,"props":2708,"children":2710},{"code":2709,"language":1442,"meta":8,"className":1443,"style":8},"git branch\n",[2711],{"type":18,"tag":139,"props":2712,"children":2713},{"__ignoreMap":8},[2714],{"type":18,"tag":1449,"props":2715,"children":2716},{"class":1451,"line":1452},[2717,2721],{"type":18,"tag":1449,"props":2718,"children":2719},{"style":1456},[2720],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2722,"children":2723},{"style":1462},[2724],{"type":24,"value":2725}," branch\n",{"type":18,"tag":105,"props":2727,"children":2728},{"start":1296},[2729],{"type":18,"tag":37,"props":2730,"children":2731},{},[2732],{"type":24,"value":2733},"分支重命名",{"type":18,"tag":837,"props":2735,"children":2737},{"code":2736,"language":1442,"meta":8,"className":1443,"style":8},"git branch -m \u003Cnew-name>                # 重命名当前分支\ngit branch -m \u003Cold-name> \u003Cnew-name>     # 重命名指定分支\n",[2738],{"type":18,"tag":139,"props":2739,"children":2740},{"__ignoreMap":8},[2741,2780],{"type":18,"tag":1449,"props":2742,"children":2743},{"class":1451,"line":1452},[2744,2748,2753,2757,2761,2766,2771,2775],{"type":18,"tag":1449,"props":2745,"children":2746},{"style":1456},[2747],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2749,"children":2750},{"style":1462},[2751],{"type":24,"value":2752}," branch",{"type":18,"tag":1449,"props":2754,"children":2755},{"style":1468},[2756],{"type":24,"value":2038},{"type":18,"tag":1449,"props":2758,"children":2759},{"style":1938},[2760],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2762,"children":2763},{"style":1462},[2764],{"type":24,"value":2765},"new-nam",{"type":18,"tag":1449,"props":2767,"children":2768},{"style":1512},[2769],{"type":24,"value":2770},"e",{"type":18,"tag":1449,"props":2772,"children":2773},{"style":1938},[2774],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2776,"children":2777},{"style":1474},[2778],{"type":24,"value":2779},"                # 重命名当前分支\n",{"type":18,"tag":1449,"props":2781,"children":2782},{"class":1451,"line":1296},[2783,2787,2791,2795,2799,2804,2808,2812,2816,2820,2824,2828],{"type":18,"tag":1449,"props":2784,"children":2785},{"style":1456},[2786],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2788,"children":2789},{"style":1462},[2790],{"type":24,"value":2752},{"type":18,"tag":1449,"props":2792,"children":2793},{"style":1468},[2794],{"type":24,"value":2038},{"type":18,"tag":1449,"props":2796,"children":2797},{"style":1938},[2798],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2800,"children":2801},{"style":1462},[2802],{"type":24,"value":2803},"old-nam",{"type":18,"tag":1449,"props":2805,"children":2806},{"style":1512},[2807],{"type":24,"value":2770},{"type":18,"tag":1449,"props":2809,"children":2810},{"style":1938},[2811],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2813,"children":2814},{"style":1938},[2815],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2817,"children":2818},{"style":1462},[2819],{"type":24,"value":2765},{"type":18,"tag":1449,"props":2821,"children":2822},{"style":1512},[2823],{"type":24,"value":2770},{"type":18,"tag":1449,"props":2825,"children":2826},{"style":1938},[2827],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2829,"children":2830},{"style":1474},[2831],{"type":24,"value":2832},"     # 重命名指定分支\n",{"type":18,"tag":105,"props":2834,"children":2835},{"start":1303},[2836],{"type":18,"tag":37,"props":2837,"children":2838},{},[2839],{"type":24,"value":2840},"创建分支",{"type":18,"tag":837,"props":2842,"children":2844},{"code":2843,"language":1442,"meta":8,"className":1443,"style":8},"git branch \u003Cbranch-name>                # 创建一个新的分支，指针和当前分支相同\ngit branch \u003Cbranch-name> \u003Ccommit-hash>  # 创建一个新的分支，指针指向指定的提交\n",[2845],{"type":18,"tag":139,"props":2846,"children":2847},{"__ignoreMap":8},[2848,2881],{"type":18,"tag":1449,"props":2849,"children":2850},{"class":1451,"line":1452},[2851,2855,2859,2863,2868,2872,2876],{"type":18,"tag":1449,"props":2852,"children":2853},{"style":1456},[2854],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2856,"children":2857},{"style":1462},[2858],{"type":24,"value":2752},{"type":18,"tag":1449,"props":2860,"children":2861},{"style":1938},[2862],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2864,"children":2865},{"style":1462},[2866],{"type":24,"value":2867},"branch-nam",{"type":18,"tag":1449,"props":2869,"children":2870},{"style":1512},[2871],{"type":24,"value":2770},{"type":18,"tag":1449,"props":2873,"children":2874},{"style":1938},[2875],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2877,"children":2878},{"style":1474},[2879],{"type":24,"value":2880},"                # 创建一个新的分支，指针和当前分支相同\n",{"type":18,"tag":1449,"props":2882,"children":2883},{"class":1451,"line":1296},[2884,2888,2892,2896,2900,2904,2908,2912,2917,2922,2926],{"type":18,"tag":1449,"props":2885,"children":2886},{"style":1456},[2887],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2889,"children":2890},{"style":1462},[2891],{"type":24,"value":2752},{"type":18,"tag":1449,"props":2893,"children":2894},{"style":1938},[2895],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2897,"children":2898},{"style":1462},[2899],{"type":24,"value":2867},{"type":18,"tag":1449,"props":2901,"children":2902},{"style":1512},[2903],{"type":24,"value":2770},{"type":18,"tag":1449,"props":2905,"children":2906},{"style":1938},[2907],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2909,"children":2910},{"style":1938},[2911],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2913,"children":2914},{"style":1462},[2915],{"type":24,"value":2916},"commit-has",{"type":18,"tag":1449,"props":2918,"children":2919},{"style":1512},[2920],{"type":24,"value":2921},"h",{"type":18,"tag":1449,"props":2923,"children":2924},{"style":1938},[2925],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2927,"children":2928},{"style":1474},[2929],{"type":24,"value":2930},"  # 创建一个新的分支，指针指向指定的提交\n",{"type":18,"tag":105,"props":2932,"children":2933},{"start":1737},[2934],{"type":18,"tag":37,"props":2935,"children":2936},{},[2937],{"type":24,"value":2938},"切换分支",{"type":18,"tag":837,"props":2940,"children":2942},{"code":2941,"language":1442,"meta":8,"className":1443,"style":8},"git switch \u003Cbranch-name>    # 切换到指定分支\ngit switch -                # 切换到上一个分支，非常方便的在两个分支间来回切换\ngit switch -c \u003Cbranch-name> # 创建并切换分支的快捷方式：\n",[2943],{"type":18,"tag":139,"props":2944,"children":2945},{"__ignoreMap":8},[2946,2979,3000],{"type":18,"tag":1449,"props":2947,"children":2948},{"class":1451,"line":1452},[2949,2953,2958,2962,2966,2970,2974],{"type":18,"tag":1449,"props":2950,"children":2951},{"style":1456},[2952],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2954,"children":2955},{"style":1462},[2956],{"type":24,"value":2957}," switch",{"type":18,"tag":1449,"props":2959,"children":2960},{"style":1938},[2961],{"type":24,"value":1941},{"type":18,"tag":1449,"props":2963,"children":2964},{"style":1462},[2965],{"type":24,"value":2867},{"type":18,"tag":1449,"props":2967,"children":2968},{"style":1512},[2969],{"type":24,"value":2770},{"type":18,"tag":1449,"props":2971,"children":2972},{"style":1938},[2973],{"type":24,"value":2639},{"type":18,"tag":1449,"props":2975,"children":2976},{"style":1474},[2977],{"type":24,"value":2978},"    # 切换到指定分支\n",{"type":18,"tag":1449,"props":2980,"children":2981},{"class":1451,"line":1296},[2982,2986,2990,2995],{"type":18,"tag":1449,"props":2983,"children":2984},{"style":1456},[2985],{"type":24,"value":1459},{"type":18,"tag":1449,"props":2987,"children":2988},{"style":1462},[2989],{"type":24,"value":2957},{"type":18,"tag":1449,"props":2991,"children":2992},{"style":1462},[2993],{"type":24,"value":2994}," -",{"type":18,"tag":1449,"props":2996,"children":2997},{"style":1474},[2998],{"type":24,"value":2999},"                # 切换到上一个分支，非常方便的在两个分支间来回切换\n",{"type":18,"tag":1449,"props":3001,"children":3002},{"class":1451,"line":1303},[3003,3007,3011,3016,3020,3024,3028,3032],{"type":18,"tag":1449,"props":3004,"children":3005},{"style":1456},[3006],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3008,"children":3009},{"style":1462},[3010],{"type":24,"value":2957},{"type":18,"tag":1449,"props":3012,"children":3013},{"style":1468},[3014],{"type":24,"value":3015}," -c",{"type":18,"tag":1449,"props":3017,"children":3018},{"style":1938},[3019],{"type":24,"value":1941},{"type":18,"tag":1449,"props":3021,"children":3022},{"style":1462},[3023],{"type":24,"value":2867},{"type":18,"tag":1449,"props":3025,"children":3026},{"style":1512},[3027],{"type":24,"value":2770},{"type":18,"tag":1449,"props":3029,"children":3030},{"style":1938},[3031],{"type":24,"value":2639},{"type":18,"tag":1449,"props":3033,"children":3034},{"style":1474},[3035],{"type":24,"value":3036}," # 创建并切换分支的快捷方式：\n",{"type":18,"tag":105,"props":3038,"children":3039},{"start":1763},[3040],{"type":18,"tag":37,"props":3041,"children":3042},{},[3043],{"type":24,"value":3044},"删除分支",{"type":18,"tag":837,"props":3046,"children":3048},{"code":3047,"language":1442,"meta":8,"className":1443,"style":8},"git branch -d \u003Cbranch-name> # 删除指定分支\ngit branch -D \u003Cbranch-name> # 强制删除指定分支\n",[3049],{"type":18,"tag":139,"props":3050,"children":3051},{"__ignoreMap":8},[3052,3089],{"type":18,"tag":1449,"props":3053,"children":3054},{"class":1451,"line":1452},[3055,3059,3063,3068,3072,3076,3080,3084],{"type":18,"tag":1449,"props":3056,"children":3057},{"style":1456},[3058],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3060,"children":3061},{"style":1462},[3062],{"type":24,"value":2752},{"type":18,"tag":1449,"props":3064,"children":3065},{"style":1468},[3066],{"type":24,"value":3067}," -d",{"type":18,"tag":1449,"props":3069,"children":3070},{"style":1938},[3071],{"type":24,"value":1941},{"type":18,"tag":1449,"props":3073,"children":3074},{"style":1462},[3075],{"type":24,"value":2867},{"type":18,"tag":1449,"props":3077,"children":3078},{"style":1512},[3079],{"type":24,"value":2770},{"type":18,"tag":1449,"props":3081,"children":3082},{"style":1938},[3083],{"type":24,"value":2639},{"type":18,"tag":1449,"props":3085,"children":3086},{"style":1474},[3087],{"type":24,"value":3088}," # 删除指定分支\n",{"type":18,"tag":1449,"props":3090,"children":3091},{"class":1451,"line":1296},[3092,3096,3100,3105,3109,3113,3117,3121],{"type":18,"tag":1449,"props":3093,"children":3094},{"style":1456},[3095],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3097,"children":3098},{"style":1462},[3099],{"type":24,"value":2752},{"type":18,"tag":1449,"props":3101,"children":3102},{"style":1468},[3103],{"type":24,"value":3104}," -D",{"type":18,"tag":1449,"props":3106,"children":3107},{"style":1938},[3108],{"type":24,"value":1941},{"type":18,"tag":1449,"props":3110,"children":3111},{"style":1462},[3112],{"type":24,"value":2867},{"type":18,"tag":1449,"props":3114,"children":3115},{"style":1512},[3116],{"type":24,"value":2770},{"type":18,"tag":1449,"props":3118,"children":3119},{"style":1938},[3120],{"type":24,"value":2639},{"type":18,"tag":1449,"props":3122,"children":3123},{"style":1474},[3124],{"type":24,"value":3125}," # 强制删除指定分支\n",{"type":18,"tag":1522,"props":3127,"children":3129},{"id":3128},"分支的基本生命周期",[3130],{"type":24,"value":3128},{"type":18,"tag":27,"props":3132,"children":3133},{},[3134],{"type":18,"tag":41,"props":3135,"children":3136},{},[3137],{"type":24,"value":3138},"永远不能在主分支上直接改动，主分支永远保证功能的完整可用、可部署",{"type":18,"tag":105,"props":3140,"children":3141},{},[3142,3152],{"type":18,"tag":37,"props":3143,"children":3144},{},[3145,3150],{"type":18,"tag":41,"props":3146,"children":3147},{},[3148],{"type":24,"value":3149},"新需求",{"type":24,"value":3151},"：功能\u002Fbug修复\u002F版本回滚\u002F...",{"type":18,"tag":37,"props":3153,"children":3154},{},[3155,3160],{"type":18,"tag":41,"props":3156,"children":3157},{},[3158],{"type":24,"value":3159},"新建分支",{"type":24,"value":742},{"type":18,"tag":837,"props":3162,"children":3164},{"code":3163,"language":1442,"meta":8,"className":1443,"style":8},"feature\u002F*   - 新功能开发\nbugfix\u002F*    - 缺陷修复\nhotfix\u002F*    - 紧急生产修复\nrelease\u002F*   - 版本发布\nchore\u002F*     - 维护性任务\ndocs\u002F*      - 文档更新\nrefactor\u002F*  - 代码重构\n",[3165],{"type":18,"tag":139,"props":3166,"children":3167},{"__ignoreMap":8},[3168,3186,3204,3221,3238,3256,3275],{"type":18,"tag":1449,"props":3169,"children":3170},{"class":1451,"line":1452},[3171,3176,3181],{"type":18,"tag":1449,"props":3172,"children":3173},{"style":1456},[3174],{"type":24,"value":3175},"feature\u002F*",{"type":18,"tag":1449,"props":3177,"children":3178},{"style":1462},[3179],{"type":24,"value":3180},"   -",{"type":18,"tag":1449,"props":3182,"children":3183},{"style":1462},[3184],{"type":24,"value":3185}," 新功能开发\n",{"type":18,"tag":1449,"props":3187,"children":3188},{"class":1451,"line":1296},[3189,3194,3199],{"type":18,"tag":1449,"props":3190,"children":3191},{"style":1456},[3192],{"type":24,"value":3193},"bugfix\u002F*",{"type":18,"tag":1449,"props":3195,"children":3196},{"style":1462},[3197],{"type":24,"value":3198},"    -",{"type":18,"tag":1449,"props":3200,"children":3201},{"style":1462},[3202],{"type":24,"value":3203}," 缺陷修复\n",{"type":18,"tag":1449,"props":3205,"children":3206},{"class":1451,"line":1303},[3207,3212,3216],{"type":18,"tag":1449,"props":3208,"children":3209},{"style":1456},[3210],{"type":24,"value":3211},"hotfix\u002F*",{"type":18,"tag":1449,"props":3213,"children":3214},{"style":1462},[3215],{"type":24,"value":3198},{"type":18,"tag":1449,"props":3217,"children":3218},{"style":1462},[3219],{"type":24,"value":3220}," 紧急生产修复\n",{"type":18,"tag":1449,"props":3222,"children":3223},{"class":1451,"line":1737},[3224,3229,3233],{"type":18,"tag":1449,"props":3225,"children":3226},{"style":1456},[3227],{"type":24,"value":3228},"release\u002F*",{"type":18,"tag":1449,"props":3230,"children":3231},{"style":1462},[3232],{"type":24,"value":3180},{"type":18,"tag":1449,"props":3234,"children":3235},{"style":1462},[3236],{"type":24,"value":3237}," 版本发布\n",{"type":18,"tag":1449,"props":3239,"children":3240},{"class":1451,"line":1763},[3241,3246,3251],{"type":18,"tag":1449,"props":3242,"children":3243},{"style":1456},[3244],{"type":24,"value":3245},"chore\u002F*",{"type":18,"tag":1449,"props":3247,"children":3248},{"style":1462},[3249],{"type":24,"value":3250},"     -",{"type":18,"tag":1449,"props":3252,"children":3253},{"style":1462},[3254],{"type":24,"value":3255}," 维护性任务\n",{"type":18,"tag":1449,"props":3257,"children":3259},{"class":1451,"line":3258},6,[3260,3265,3270],{"type":18,"tag":1449,"props":3261,"children":3262},{"style":1456},[3263],{"type":24,"value":3264},"docs\u002F*",{"type":18,"tag":1449,"props":3266,"children":3267},{"style":1462},[3268],{"type":24,"value":3269},"      -",{"type":18,"tag":1449,"props":3271,"children":3272},{"style":1462},[3273],{"type":24,"value":3274}," 文档更新\n",{"type":18,"tag":1449,"props":3276,"children":3278},{"class":1451,"line":3277},7,[3279,3284,3289],{"type":18,"tag":1449,"props":3280,"children":3281},{"style":1456},[3282],{"type":24,"value":3283},"refactor\u002F*",{"type":18,"tag":1449,"props":3285,"children":3286},{"style":1462},[3287],{"type":24,"value":3288},"  -",{"type":18,"tag":1449,"props":3290,"children":3291},{"style":1462},[3292],{"type":24,"value":3293}," 代码重构\n",{"type":18,"tag":105,"props":3295,"children":3296},{"start":1303},[3297,3307,3315,3323],{"type":18,"tag":37,"props":3298,"children":3299},{},[3300,3305],{"type":18,"tag":41,"props":3301,"children":3302},{},[3303],{"type":24,"value":3304},"在分支上开发测试",{"type":24,"value":3306},"：可能产生多次提交",{"type":18,"tag":37,"props":3308,"children":3309},{},[3310],{"type":18,"tag":41,"props":3311,"children":3312},{},[3313],{"type":24,"value":3314},"合并到主分支",{"type":18,"tag":37,"props":3316,"children":3317},{},[3318],{"type":18,"tag":41,"props":3319,"children":3320},{},[3321],{"type":24,"value":3322},"主分支测试",{"type":18,"tag":37,"props":3324,"children":3325},{},[3326],{"type":18,"tag":41,"props":3327,"children":3328},{},[3329],{"type":24,"value":3330},"删除开发分支",{"type":18,"tag":1522,"props":3332,"children":3334},{"id":3333},"分支常见问题",[3335],{"type":24,"value":3333},{"type":18,"tag":33,"props":3337,"children":3338},{},[3339],{"type":18,"tag":37,"props":3340,"children":3341},{},[3342],{"type":18,"tag":41,"props":3343,"children":3344},{},[3345],{"type":24,"value":3346},"如何保留现场",{"type":18,"tag":837,"props":3348,"children":3350},{"code":3349},"git stash -a                # 保存当前工作区的修改到存储库\n# 切换分支工作...\n# 切回分支\ngit stash list              # [可选]查询当前存储库\ngit stash pop \u003Cstash-id>    # 调用某个存储库恢复工作区，同时删除存储库\n# 如果存库是最后一个，可以省略 id\n",[3351],{"type":18,"tag":139,"props":3352,"children":3353},{"__ignoreMap":8},[3354],{"type":24,"value":3349},{"type":18,"tag":33,"props":3356,"children":3357},{},[3358],{"type":18,"tag":37,"props":3359,"children":3360},{},[3361,3366],{"type":18,"tag":41,"props":3362,"children":3363},{},[3364],{"type":24,"value":3365},"如何解决冲突",{"type":24,"value":3367},"：冲突必须手动解决，尤其是主分支的冲突",{"type":18,"tag":19,"props":3369,"children":3371},{"id":3370},"远程仓库",[3372],{"type":24,"value":3370},{"type":18,"tag":1522,"props":3374,"children":3376},{"id":3375},"注册-github-账号",[3377],{"type":24,"value":3378},"注册 github 账号",{"type":18,"tag":27,"props":3380,"children":3381},{},[3382,3388],{"type":18,"tag":1386,"props":3383,"children":3386},{"href":3384,"rel":3385},"https:\u002F\u002Fgithub.com",[1390],[3387],{"type":24,"value":3384},{"type":24,"value":3389}," 自行注册",{"type":18,"tag":1522,"props":3391,"children":3393},{"id":3392},"ssh-链接通道配置",[3394],{"type":24,"value":3395},"SSH 链接通道配置",{"type":18,"tag":105,"props":3397,"children":3398},{},[3399],{"type":18,"tag":37,"props":3400,"children":3401},{},[3402],{"type":24,"value":3403},"本地生成密钥对",{"type":18,"tag":837,"props":3405,"children":3407},{"code":3406,"language":1442,"meta":8,"className":1443,"style":8},"ssh-keygen -t ed25519 -C \"注册 github 的邮箱地址\" -f ~\u002F.ssh\u002Fxxx_github_key\n",[3408],{"type":18,"tag":139,"props":3409,"children":3410},{"__ignoreMap":8},[3411],{"type":18,"tag":1449,"props":3412,"children":3413},{"class":1451,"line":1452},[3414,3419,3424,3429,3434,3439,3444],{"type":18,"tag":1449,"props":3415,"children":3416},{"style":1456},[3417],{"type":24,"value":3418},"ssh-keygen",{"type":18,"tag":1449,"props":3420,"children":3421},{"style":1468},[3422],{"type":24,"value":3423}," -t",{"type":18,"tag":1449,"props":3425,"children":3426},{"style":1462},[3427],{"type":24,"value":3428}," ed25519",{"type":18,"tag":1449,"props":3430,"children":3431},{"style":1468},[3432],{"type":24,"value":3433}," -C",{"type":18,"tag":1449,"props":3435,"children":3436},{"style":1462},[3437],{"type":24,"value":3438}," \"注册 github 的邮箱地址\"",{"type":18,"tag":1449,"props":3440,"children":3441},{"style":1468},[3442],{"type":24,"value":3443}," -f",{"type":18,"tag":1449,"props":3445,"children":3446},{"style":1462},[3447],{"type":24,"value":3448}," ~\u002F.ssh\u002Fxxx_github_key\n",{"type":18,"tag":27,"props":3450,"children":3451},{},[3452,3454,3460],{"type":24,"value":3453},"生成完后，到电脑的 ",{"type":18,"tag":139,"props":3455,"children":3457},{"className":3456},[],[3458],{"type":24,"value":3459},"～\u002F.ssh",{"type":24,"value":3461}," 目录朗可看到之前生成的两个文件：",{"type":18,"tag":837,"props":3463,"children":3465},{"code":3464},"xxx_github_key          # 私钥\nxxx_github_key.pub      # 公钥\n",[3466],{"type":18,"tag":139,"props":3467,"children":3468},{"__ignoreMap":8},[3469],{"type":24,"value":3464},{"type":18,"tag":105,"props":3471,"children":3472},{"start":1296},[3473],{"type":18,"tag":37,"props":3474,"children":3475},{},[3476],{"type":24,"value":3477},"到 github 配置公钥",{"type":18,"tag":27,"props":3479,"children":3480},{},[3481,3483,3489],{"type":24,"value":3482},"登录 github 后，在 github 的地址 ",{"type":18,"tag":1386,"props":3484,"children":3487},{"href":3485,"rel":3486},"https:\u002F\u002Fgithub.com\u002Fsettings\u002Fkeys",[1390],[3488],{"type":24,"value":3485},{"type":24,"value":3490}," 地址下自行配置",{"type":18,"tag":1522,"props":3492,"children":3494},{"id":3493},"配置密钥的配对规则",[3495],{"type":24,"value":3493},{"type":18,"tag":837,"props":3497,"children":3499},{"code":3498},"flowchart LR\n    PrivateKey1 \u003C--> PublicKey1ForGithub\n    PrivateKey2 \u003C--> PublicKey2ForGithub\n    PrivateKey1 \u003C--> PublicKey1ForGitee\n    PrivateKey3 \u003C--> PublicKey3ForGitlab\n",[3500],{"type":18,"tag":139,"props":3501,"children":3502},{"__ignoreMap":8},[3503],{"type":24,"value":3498},{"type":18,"tag":105,"props":3505,"children":3506},{},[3507,3520],{"type":18,"tag":37,"props":3508,"children":3509},{},[3510,3512,3518],{"type":24,"value":3511},"打开 ",{"type":18,"tag":139,"props":3513,"children":3515},{"className":3514},[],[3516],{"type":24,"value":3517},"~\u002F.ssh\u002Fconfig",{"type":24,"value":3519},"，没有就创建一个",{"type":18,"tag":37,"props":3521,"children":3522},{},[3523],{"type":24,"value":3524},"配置规则",{"type":18,"tag":837,"props":3526,"children":3528},{"code":3527},"# 规则 1\nHost wyemail.github.com     # 当连接 git@wyemail.github.com 时会匹配到此规则\n    HostName github.com     # 实际上链接发出的主机\n    IdentityFile ~\u002F.ssh\u002Fwyemail_github_key  # 使用的私钥文件\n    User git # 固定写法\n\n# 规则 2\nHost a                          # 当连接 git@a 时会匹配到此规则\n    HostName github.com         # 实际上链接发出的主机\n    IdentityFile ~\u002F.ssh\u002Fa_github_key    # 使用的私钥文件\n    User git # 固定写法 \n    \n上述 PrivateKey 与 PublicKey 的关系图中，一条双向连接线就对应此处的一个规则\n",[3529],{"type":18,"tag":139,"props":3530,"children":3531},{"__ignoreMap":8},[3532],{"type":24,"value":3527},{"type":18,"tag":1522,"props":3534,"children":3536},{"id":3535},"仓库和别名",[3537],{"type":24,"value":3535},{"type":18,"tag":27,"props":3539,"children":3540},{},[3541],{"type":24,"value":3542},"要和远程仓库同步，先得有远程仓库",{"type":18,"tag":105,"props":3544,"children":3545},{},[3546,3551],{"type":18,"tag":37,"props":3547,"children":3548},{},[3549],{"type":24,"value":3550},"在 github 中创建一个远程仓库",{"type":18,"tag":37,"props":3552,"children":3553},{},[3554],{"type":24,"value":3555},"在本地仓库中添加远程仓库的别名",{"type":18,"tag":27,"props":3557,"children":3558},{},[3559],{"type":24,"value":3560},"别名的常见操作",{"type":18,"tag":837,"props":3562,"children":3564},{"code":3563,"language":1442,"meta":8,"className":1443,"style":8},"# 查看当前的远程仓库的别名\ngit remote          # 简要信息\ngit remote -v       # 详细信息\n\n# 添加别名\ngit remote add 远程仓库别名 远程仓库ssh地址\n\n# 修改别名\ngit remote rename 原别名 新别名\n\n# 删除别名\ngit remote remove 要删除的别名\n",[3565],{"type":18,"tag":139,"props":3566,"children":3567},{"__ignoreMap":8},[3568,3576,3593,3614,3623,3631,3656,3663,3672,3699,3707,3716],{"type":18,"tag":1449,"props":3569,"children":3570},{"class":1451,"line":1452},[3571],{"type":18,"tag":1449,"props":3572,"children":3573},{"style":1474},[3574],{"type":24,"value":3575},"# 查看当前的远程仓库的别名\n",{"type":18,"tag":1449,"props":3577,"children":3578},{"class":1451,"line":1296},[3579,3583,3588],{"type":18,"tag":1449,"props":3580,"children":3581},{"style":1456},[3582],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3584,"children":3585},{"style":1462},[3586],{"type":24,"value":3587}," remote",{"type":18,"tag":1449,"props":3589,"children":3590},{"style":1474},[3591],{"type":24,"value":3592},"          # 简要信息\n",{"type":18,"tag":1449,"props":3594,"children":3595},{"class":1451,"line":1303},[3596,3600,3604,3609],{"type":18,"tag":1449,"props":3597,"children":3598},{"style":1456},[3599],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3601,"children":3602},{"style":1462},[3603],{"type":24,"value":3587},{"type":18,"tag":1449,"props":3605,"children":3606},{"style":1468},[3607],{"type":24,"value":3608}," -v",{"type":18,"tag":1449,"props":3610,"children":3611},{"style":1474},[3612],{"type":24,"value":3613},"       # 详细信息\n",{"type":18,"tag":1449,"props":3615,"children":3616},{"class":1451,"line":1737},[3617],{"type":18,"tag":1449,"props":3618,"children":3620},{"emptyLinePlaceholder":3619},true,[3621],{"type":24,"value":3622},"\n",{"type":18,"tag":1449,"props":3624,"children":3625},{"class":1451,"line":1763},[3626],{"type":18,"tag":1449,"props":3627,"children":3628},{"style":1474},[3629],{"type":24,"value":3630},"# 添加别名\n",{"type":18,"tag":1449,"props":3632,"children":3633},{"class":1451,"line":3258},[3634,3638,3642,3646,3651],{"type":18,"tag":1449,"props":3635,"children":3636},{"style":1456},[3637],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3639,"children":3640},{"style":1462},[3641],{"type":24,"value":3587},{"type":18,"tag":1449,"props":3643,"children":3644},{"style":1462},[3645],{"type":24,"value":1935},{"type":18,"tag":1449,"props":3647,"children":3648},{"style":1462},[3649],{"type":24,"value":3650}," 远程仓库别名",{"type":18,"tag":1449,"props":3652,"children":3653},{"style":1462},[3654],{"type":24,"value":3655}," 远程仓库ssh地址\n",{"type":18,"tag":1449,"props":3657,"children":3658},{"class":1451,"line":3277},[3659],{"type":18,"tag":1449,"props":3660,"children":3661},{"emptyLinePlaceholder":3619},[3662],{"type":24,"value":3622},{"type":18,"tag":1449,"props":3664,"children":3666},{"class":1451,"line":3665},8,[3667],{"type":18,"tag":1449,"props":3668,"children":3669},{"style":1474},[3670],{"type":24,"value":3671},"# 修改别名\n",{"type":18,"tag":1449,"props":3673,"children":3675},{"class":1451,"line":3674},9,[3676,3680,3684,3689,3694],{"type":18,"tag":1449,"props":3677,"children":3678},{"style":1456},[3679],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3681,"children":3682},{"style":1462},[3683],{"type":24,"value":3587},{"type":18,"tag":1449,"props":3685,"children":3686},{"style":1462},[3687],{"type":24,"value":3688}," rename",{"type":18,"tag":1449,"props":3690,"children":3691},{"style":1462},[3692],{"type":24,"value":3693}," 原别名",{"type":18,"tag":1449,"props":3695,"children":3696},{"style":1462},[3697],{"type":24,"value":3698}," 新别名\n",{"type":18,"tag":1449,"props":3700,"children":3702},{"class":1451,"line":3701},10,[3703],{"type":18,"tag":1449,"props":3704,"children":3705},{"emptyLinePlaceholder":3619},[3706],{"type":24,"value":3622},{"type":18,"tag":1449,"props":3708,"children":3710},{"class":1451,"line":3709},11,[3711],{"type":18,"tag":1449,"props":3712,"children":3713},{"style":1474},[3714],{"type":24,"value":3715},"# 删除别名\n",{"type":18,"tag":1449,"props":3717,"children":3719},{"class":1451,"line":3718},12,[3720,3724,3728,3733],{"type":18,"tag":1449,"props":3721,"children":3722},{"style":1456},[3723],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3725,"children":3726},{"style":1462},[3727],{"type":24,"value":3587},{"type":18,"tag":1449,"props":3729,"children":3730},{"style":1462},[3731],{"type":24,"value":3732}," remove",{"type":18,"tag":1449,"props":3734,"children":3735},{"style":1462},[3736],{"type":24,"value":3737}," 要删除的别名\n",{"type":18,"tag":1522,"props":3739,"children":3741},{"id":3740},"远程仓库与本地仓库之间的分支同步",[3742],{"type":24,"value":3740},{"type":18,"tag":27,"props":3744,"children":3745},{},[3746,3751],{"type":18,"tag":41,"props":3747,"children":3748},{},[3749],{"type":24,"value":3750},"push 命令",{"type":24,"value":742},{"type":18,"tag":837,"props":3753,"children":3755},{"code":3754},"  本地仓库                  远程仓库\n   \n   master --- git push ---> master\n                              |\n",[3756],{"type":18,"tag":139,"props":3757,"children":3758},{"__ignoreMap":8},[3759],{"type":24,"value":3754},{"type":18,"tag":27,"props":3761,"children":3762},{},[3763],{"type":24,"value":3764},"origin\u002Fmaster \u003C-- 自动同步 --------|",{"type":18,"tag":837,"props":3766,"children":3768},{"code":3767,"language":1442,"meta":8,"className":1443,"style":8},"# 将本地的某个分支推送到指定仓库\ngit push -u 远程仓库别名 本地分支名\n",[3769],{"type":18,"tag":139,"props":3770,"children":3771},{"__ignoreMap":8},[3772,3780],{"type":18,"tag":1449,"props":3773,"children":3774},{"class":1451,"line":1452},[3775],{"type":18,"tag":1449,"props":3776,"children":3777},{"style":1474},[3778],{"type":24,"value":3779},"# 将本地的某个分支推送到指定仓库\n",{"type":18,"tag":1449,"props":3781,"children":3782},{"class":1451,"line":1296},[3783,3787,3791,3795,3799],{"type":18,"tag":1449,"props":3784,"children":3785},{"style":1456},[3786],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3788,"children":3789},{"style":1462},[3790],{"type":24,"value":2533},{"type":18,"tag":1449,"props":3792,"children":3793},{"style":1468},[3794],{"type":24,"value":2538},{"type":18,"tag":1449,"props":3796,"children":3797},{"style":1462},[3798],{"type":24,"value":3650},{"type":18,"tag":1449,"props":3800,"children":3801},{"style":1462},[3802],{"type":24,"value":3803}," 本地分支名\n",{"type":18,"tag":27,"props":3805,"children":3806},{},[3807],{"type":24,"value":3808},"细节说明：",{"type":18,"tag":33,"props":3810,"children":3811},{},[3812,3817,3853],{"type":18,"tag":37,"props":3813,"children":3814},{},[3815],{"type":24,"value":3816},"如果远程没有相关分支，则在远程创建同名分支",{"type":18,"tag":37,"props":3818,"children":3819},{},[3820,3822],{"type":24,"value":3821},"推送完成后，会在本地创建远程跟踪分支\n",{"type":18,"tag":33,"props":3823,"children":3824},{},[3825,3843,3848],{"type":18,"tag":37,"props":3826,"children":3827},{},[3828,3830,3835,3837],{"type":24,"value":3829},"跟踪分支自动命名：",{"type":18,"tag":41,"props":3831,"children":3832},{},[3833],{"type":24,"value":3834},"仓库别名\u002F分支名",{"type":24,"value":3836},"，如 ",{"type":18,"tag":139,"props":3838,"children":3840},{"className":3839},[],[3841],{"type":24,"value":3842},"origin\u002Fmaster",{"type":18,"tag":37,"props":3844,"children":3845},{},[3846],{"type":24,"value":3847},"跟踪分支是只读的，它的目的在于同步远程分支",{"type":18,"tag":37,"props":3849,"children":3850},{},[3851],{"type":24,"value":3852},"推送完成后，会自动同步远程跟踪分支",{"type":18,"tag":37,"props":3854,"children":3855},{},[3856,3858,3864,3866,3872,3874,3880],{"type":24,"value":3857},"由于使用了参数 ",{"type":18,"tag":139,"props":3859,"children":3861},{"className":3860},[],[3862],{"type":24,"value":3863},"-u",{"type":24,"value":3865}," 在跟踪分支创建后，会自动把本地分支 ",{"type":18,"tag":139,"props":3867,"children":3869},{"className":3868},[],[3870],{"type":24,"value":3871},"master",{"type":24,"value":3873}," 绑定到跟踪分支 ",{"type":18,"tag":139,"props":3875,"children":3877},{"className":3876},[],[3878],{"type":24,"value":3879},"origin\u002Fmain",{"type":18,"tag":33,"props":3881,"children":3882},{},[3883],{"type":18,"tag":37,"props":3884,"children":3885},{},[3886,3888,3893],{"type":24,"value":3887},"后续仅需要使用 ",{"type":18,"tag":139,"props":3889,"children":3891},{"className":3890},[],[3892],{"type":24,"value":578},{"type":24,"value":3894}," 即可推送当前的 master 分支",{"type":18,"tag":27,"props":3896,"children":3897},{},[3898],{"type":24,"value":3899},"这样，就完成了本地到远程的同步",{"type":18,"tag":27,"props":3901,"children":3902},{},[3903,3908],{"type":18,"tag":41,"props":3904,"children":3905},{},[3906],{"type":24,"value":3907},"pull 命令",{"type":24,"value":742},{"type":18,"tag":837,"props":3910,"children":3912},{"code":3911},"  本地仓库                         远程仓库\n   \n   master\n     ∧\n     | git merge\n     |                      \n",[3913],{"type":18,"tag":139,"props":3914,"children":3915},{"__ignoreMap":8},[3916],{"type":24,"value":3911},{"type":18,"tag":27,"props":3918,"children":3919},{},[3920],{"type":24,"value":3921},"origin\u002Fmaster \u003C------ git fetch ------ master",{"type":18,"tag":105,"props":3923,"children":3924},{},[3925],{"type":18,"tag":37,"props":3926,"children":3927},{},[3928,3929,3935],{"type":24,"value":1068},{"type":18,"tag":139,"props":3930,"children":3932},{"className":3931},[],[3933],{"type":24,"value":3934},"git fetch",{"type":24,"value":3936}," 命令",{"type":18,"tag":837,"props":3938,"children":3940},{"code":3939,"language":1442,"meta":8,"className":1443,"style":8},"git fetch 远程仓库别名 远程分支名\n",[3941],{"type":18,"tag":139,"props":3942,"children":3943},{"__ignoreMap":8},[3944],{"type":18,"tag":1449,"props":3945,"children":3946},{"class":1451,"line":1452},[3947,3951,3956,3960],{"type":18,"tag":1449,"props":3948,"children":3949},{"style":1456},[3950],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3952,"children":3953},{"style":1462},[3954],{"type":24,"value":3955}," fetch",{"type":18,"tag":1449,"props":3957,"children":3958},{"style":1462},[3959],{"type":24,"value":3650},{"type":18,"tag":1449,"props":3961,"children":3962},{"style":1462},[3963],{"type":24,"value":3964}," 远程分支名\n",{"type":18,"tag":105,"props":3966,"children":3967},{"start":1296},[3968],{"type":18,"tag":37,"props":3969,"children":3970},{},[3971],{"type":24,"value":3972},"使用 git merge 命令合并分支",{"type":18,"tag":837,"props":3974,"children":3976},{"code":3975,"language":1442,"meta":8,"className":1443,"style":8},"# 确保当前在对应的分支上\ngit merge 本地跟踪分支名\n",[3977],{"type":18,"tag":139,"props":3978,"children":3979},{"__ignoreMap":8},[3980,3988],{"type":18,"tag":1449,"props":3981,"children":3982},{"class":1451,"line":1452},[3983],{"type":18,"tag":1449,"props":3984,"children":3985},{"style":1474},[3986],{"type":24,"value":3987},"# 确保当前在对应的分支上\n",{"type":18,"tag":1449,"props":3989,"children":3990},{"class":1451,"line":1296},[3991,3995,4000],{"type":18,"tag":1449,"props":3992,"children":3993},{"style":1456},[3994],{"type":24,"value":1459},{"type":18,"tag":1449,"props":3996,"children":3997},{"style":1462},[3998],{"type":24,"value":3999}," merge",{"type":18,"tag":1449,"props":4001,"children":4002},{"style":1462},[4003],{"type":24,"value":4004}," 本地跟踪分支名\n",{"type":18,"tag":27,"props":4006,"children":4007},{},[4008],{"type":24,"value":4009},"这样，就完成了远程到本地的同步",{"type":18,"tag":27,"props":4011,"children":4012},{},[4013],{"type":24,"value":4014},"使用 git pull 命令，可以一步替代上面的两步操作",{"type":18,"tag":837,"props":4016,"children":4018},{"code":4017,"language":1442,"meta":8,"className":1443,"style":8},"git pull 远程仓库 远程分支\n",[4019],{"type":18,"tag":139,"props":4020,"children":4021},{"__ignoreMap":8},[4022],{"type":18,"tag":1449,"props":4023,"children":4024},{"class":1451,"line":1452},[4025,4029,4034,4039],{"type":18,"tag":1449,"props":4026,"children":4027},{"style":1456},[4028],{"type":24,"value":1459},{"type":18,"tag":1449,"props":4030,"children":4031},{"style":1462},[4032],{"type":24,"value":4033}," pull",{"type":18,"tag":1449,"props":4035,"children":4036},{"style":1462},[4037],{"type":24,"value":4038}," 远程仓库",{"type":18,"tag":1449,"props":4040,"children":4041},{"style":1462},[4042],{"type":24,"value":4043}," 远程分支\n",{"type":18,"tag":27,"props":4045,"children":4046},{},[4047,4052],{"type":18,"tag":41,"props":4048,"children":4049},{},[4050],{"type":24,"value":4051},"clone 命令",{"type":24,"value":742},{"type":18,"tag":27,"props":4054,"children":4055},{},[4056,4058,4064],{"type":24,"value":4057},"当本地没有工程时，可以使用 ",{"type":18,"tag":139,"props":4059,"children":4061},{"className":4060},[],[4062],{"type":24,"value":4063},"git clone",{"type":24,"value":4065}," 操作快速完成远程仓库的下载",{"type":18,"tag":837,"props":4067,"children":4069},{"code":4068,"language":1442,"meta":8,"className":1443,"style":8},"git clone [-b 分支名] 远程仓库地址 [本地想要保存的文件夹]\n",[4070],{"type":18,"tag":139,"props":4071,"children":4072},{"__ignoreMap":8},[4073],{"type":18,"tag":1449,"props":4074,"children":4075},{"class":1451,"line":1452},[4076,4080,4085,4090,4095,4100],{"type":18,"tag":1449,"props":4077,"children":4078},{"style":1456},[4079],{"type":24,"value":1459},{"type":18,"tag":1449,"props":4081,"children":4082},{"style":1462},[4083],{"type":24,"value":4084}," clone",{"type":18,"tag":1449,"props":4086,"children":4087},{"style":1512},[4088],{"type":24,"value":4089}," [-b ",{"type":18,"tag":1449,"props":4091,"children":4092},{"style":1462},[4093],{"type":24,"value":4094},"分支名]",{"type":18,"tag":1449,"props":4096,"children":4097},{"style":1462},[4098],{"type":24,"value":4099}," 远程仓库地址",{"type":18,"tag":1449,"props":4101,"children":4102},{"style":1512},[4103],{"type":24,"value":4104}," [本地想要保存的文件夹]\n",{"type":18,"tag":1522,"props":4106,"children":4108},{"id":4107},"同步的三种情况",[4109],{"type":24,"value":4107},{"type":18,"tag":105,"props":4111,"children":4112},{},[4113,4118,4123],{"type":18,"tag":37,"props":4114,"children":4115},{},[4116],{"type":24,"value":4117},"情况一：远程快进",{"type":18,"tag":37,"props":4119,"children":4120},{},[4121],{"type":24,"value":4122},"情况二：本地快进",{"type":18,"tag":37,"props":4124,"children":4125},{},[4126,4128],{"type":24,"value":4127},"情况三：出现冲突\n",{"type":18,"tag":105,"props":4129,"children":4130},{},[4131,4142,4155,4160,4171],{"type":18,"tag":37,"props":4132,"children":4133},{},[4134,4136],{"type":24,"value":4135},"获取远程代码：",{"type":18,"tag":139,"props":4137,"children":4139},{"className":4138},[],[4140],{"type":24,"value":4141},"git fetch orgin master",{"type":18,"tag":37,"props":4143,"children":4144},{},[4145,4147,4153],{"type":24,"value":4146},"本地进行合并，",{"type":18,"tag":139,"props":4148,"children":4150},{"className":4149},[],[4151],{"type":24,"value":4152},"git merge origin\u002Fmaster",{"type":24,"value":4154},"，报错冲突",{"type":18,"tag":37,"props":4156,"children":4157},{},[4158],{"type":24,"value":4159},"手动解决冲突",{"type":18,"tag":37,"props":4161,"children":4162},{},[4163,4165],{"type":24,"value":4164},"本地提交一次，",{"type":18,"tag":139,"props":4166,"children":4168},{"className":4167},[],[4169],{"type":24,"value":4170},"git commit -m \"xxxxx\"",{"type":18,"tag":37,"props":4172,"children":4173},{},[4174,4176],{"type":24,"value":4175},"本地推送到远程，",{"type":18,"tag":139,"props":4177,"children":4179},{"className":4178},[],[4180],{"type":24,"value":4181},"git push origin master",{"type":18,"tag":1522,"props":4183,"children":4185},{"id":4184},"简单总结",[4186],{"type":24,"value":4184},{"type":18,"tag":105,"props":4188,"children":4189},{},[4190,4195,4200],{"type":18,"tag":37,"props":4191,"children":4192},{},[4193],{"type":24,"value":4194},"正常推送拉取，没问题什么也不管",{"type":18,"tag":37,"props":4196,"children":4197},{},[4198],{"type":24,"value":4199},"推送报错，进入第 3 步",{"type":18,"tag":37,"props":4201,"children":4202},{},[4203],{"type":24,"value":4204},"拉取有冲突，解决冲突重新提交，然后进入第 2 步",{"type":18,"tag":19,"props":4206,"children":4208},{"id":4207},"github-flow",[4209],{"type":24,"value":4210},"github flow",{"type":18,"tag":1522,"props":4212,"children":4214},{"id":4213},"完整流程",[4215],{"type":24,"value":4213},{"type":18,"tag":837,"props":4217,"children":4219},{"code":4218},"sequenceDiagram\n    participant A AS 开发者\n    participant B AS 本地仓库\n    participant C AS 远程仓库\n    participant D AS 管理员\n    \n    A ->> B: 1. 拉取：master 分支\n    B --> C: 从远程同步最新代码 \n    A ->> B: 2. 开发：切换分支，多次提交\n    A ->> C: 3. 推送：推送开发分支\n    A ->> C: 4. 创建PR：base master\n    D ->> C: 5. review：代码审查\n    D ->> C: 6. 提交：提交合并到 master 分支\n    D ->> C: 7. 删除：删除开发分支\n",[4220],{"type":18,"tag":139,"props":4221,"children":4222},{"__ignoreMap":8},[4223],{"type":24,"value":4218},{"type":18,"tag":1522,"props":4225,"children":4227},{"id":4226},"开发者规范",[4228],{"type":24,"value":4226},{"type":18,"tag":105,"props":4230,"children":4231},{},[4232,4237],{"type":18,"tag":37,"props":4233,"children":4234},{},[4235],{"type":24,"value":4236},"master 分支只读",{"type":18,"tag":37,"props":4238,"children":4239},{},[4240],{"type":24,"value":4241},"基于最新的提交进行开发",{"type":18,"tag":1522,"props":4243,"children":4245},{"id":4244},"管理员规范",[4246],{"type":24,"value":4244},{"type":18,"tag":105,"props":4248,"children":4249},{},[4250,4255],{"type":18,"tag":37,"props":4251,"children":4252},{},[4253],{"type":24,"value":4254},"master 分支只能通过 PR 来修改",{"type":18,"tag":37,"props":4256,"children":4257},{},[4258],{"type":24,"value":4259},"PR 永远无冲突",{"type":18,"tag":886,"props":4261,"children":4262},{},[4263],{"type":24,"value":4264},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":8,"searchDepth":1296,"depth":1296,"links":4266},[4267,4268,4269,4270,4271,4272,4273,4274,4275,4276],{"id":1336,"depth":1296,"text":1336},{"id":1369,"depth":1296,"text":1369},{"id":1431,"depth":1296,"text":1431},{"id":1436,"depth":1296,"text":1436},{"id":1789,"depth":1296,"text":1789},{"id":1824,"depth":1296,"text":1827},{"id":1842,"depth":1296,"text":1842},{"id":2647,"depth":1296,"text":2647},{"id":3370,"depth":1296,"text":3370},{"id":4207,"depth":1296,"text":4210},"content:it:002.md","it\u002F002.md","it\u002F002",1781529092116]