[{"data":1,"prerenderedAt":2989},["ShallowReactive",2],{"content-query-tssznehLYy":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"tags":11,"body":13,"_type":2983,"_id":2984,"_source":2985,"_file":2986,"_stem":2987,"_extension":2988},"\u002Fit\u002F002","it",false,"","袁进 2026 精讲 Git","渡一名师，Git 精讲","2026-06-14",[12],"Git",{"type":14,"children":15,"toc":2971},"root",[16,24,54,59,118,123,128,213,220,253,271,276,345,480,485,490,503,516,522,535,540,545,550,567,572,577,586,605,613,687,695,745,755,785,790,1090,1095,1118,1123,1128,1154,1159,1197,1202,1207,1215,1249,1262,1350,1355,1360,1373,1381,1386,1394,1399,1404,1412,1431,1439,1538,1546,1636,1644,1742,1750,1831,1836,1844,1866,1999,2036,2041,2052,2060,2073,2078,2084,2095,2101,2109,2154,2167,2175,2183,2196,2201,2209,2230,2238,2243,2248,2261,2266,2443,2448,2457,2465,2470,2509,2514,2601,2606,2615,2623,2628,2643,2671,2679,2711,2716,2721,2750,2759,2772,2811,2816,2888,2893,2911,2917,2922,2930,2935,2948,2953,2966],{"type":17,"tag":18,"props":19,"children":21},"element","h2",{"id":20},"动机",[22],{"type":23,"value":20},"text",{"type":17,"tag":25,"props":26,"children":27},"ul",{},[28,34,39,44,49],{"type":17,"tag":29,"props":30,"children":31},"li",{},[32],{"type":23,"value":33},"不小心把正确的代码删了",{"type":17,"tag":29,"props":35,"children":36},{},[37],{"type":23,"value":38},"写错了，怎么回到之前的版本",{"type":17,"tag":29,"props":40,"children":41},{},[42],{"type":23,"value":43},"多个人怎么共同开发同一个项目",{"type":17,"tag":29,"props":45,"children":46},{},[47],{"type":23,"value":48},"这个功能之前好好的，我到底改了啥",{"type":17,"tag":29,"props":50,"children":51},{},[52],{"type":23,"value":53},"我想临时实验一个新功能",{"type":17,"tag":18,"props":55,"children":57},{"id":56},"安装",[58],{"type":23,"value":56},{"type":17,"tag":25,"props":60,"children":61},{},[62,83,99],{"type":17,"tag":29,"props":63,"children":64},{},[65,71,73,81],{"type":17,"tag":66,"props":67,"children":68},"strong",{},[69],{"type":23,"value":70},"windows",{"type":23,"value":72},"：从官网 ",{"type":17,"tag":74,"props":75,"children":79},"a",{"href":76,"rel":77},"https:\u002F\u002Fgit-scm.com\u002Finstall\u002F",[78],"nofollow",[80],{"type":23,"value":76},{"type":23,"value":82}," 下载安装",{"type":17,"tag":29,"props":84,"children":85},{},[86,91,93,98],{"type":17,"tag":66,"props":87,"children":88},{},[89],{"type":23,"value":90},"mac",{"type":23,"value":92},"：自带 git，也可以从官网 ",{"type":17,"tag":74,"props":94,"children":96},{"href":76,"rel":95},[78],[97],{"type":23,"value":76},{"type":23,"value":82},{"type":17,"tag":29,"props":100,"children":101},{},[102,107,109,116],{"type":17,"tag":66,"props":103,"children":104},{},[105],{"type":23,"value":106},"linux",{"type":23,"value":108},"：使用命令 ",{"type":17,"tag":110,"props":111,"children":113},"code",{"className":112},[],[114],{"type":23,"value":115},"sudo apt-get install git",{"type":23,"value":117}," 安装",{"type":17,"tag":18,"props":119,"children":121},{"id":120},"配置",[122],{"type":23,"value":120},{"type":17,"tag":18,"props":124,"children":126},{"id":125},"配置命令",[127],{"type":23,"value":125},{"type":17,"tag":129,"props":130,"children":134},"pre",{"code":131,"language":132,"meta":7,"className":133,"style":7},"git config -l                   # 查看当前是生效的所有配置\ngit config KEY                  # 查看当前生效的某个具体配置项 KEY 的值\ngit config [--SCOPE] KEY VALUE  # 设置\u002F更新配置项 KEY 的值\n","bash","language-bash shiki shiki-themes github-light",[135],{"type":17,"tag":110,"props":136,"children":137},{"__ignoreMap":7},[138,168,190],{"type":17,"tag":139,"props":140,"children":143},"span",{"class":141,"line":142},"line",1,[144,150,156,162],{"type":17,"tag":139,"props":145,"children":147},{"style":146},"--shiki-default:#6F42C1",[148],{"type":23,"value":149},"git",{"type":17,"tag":139,"props":151,"children":153},{"style":152},"--shiki-default:#032F62",[154],{"type":23,"value":155}," config",{"type":17,"tag":139,"props":157,"children":159},{"style":158},"--shiki-default:#005CC5",[160],{"type":23,"value":161}," -l",{"type":17,"tag":139,"props":163,"children":165},{"style":164},"--shiki-default:#6A737D",[166],{"type":23,"value":167},"                   # 查看当前是生效的所有配置\n",{"type":17,"tag":139,"props":169,"children":171},{"class":141,"line":170},2,[172,176,180,185],{"type":17,"tag":139,"props":173,"children":174},{"style":146},[175],{"type":23,"value":149},{"type":17,"tag":139,"props":177,"children":178},{"style":152},[179],{"type":23,"value":155},{"type":17,"tag":139,"props":181,"children":182},{"style":152},[183],{"type":23,"value":184}," KEY",{"type":17,"tag":139,"props":186,"children":187},{"style":164},[188],{"type":23,"value":189},"                  # 查看当前生效的某个具体配置项 KEY 的值\n",{"type":17,"tag":139,"props":191,"children":193},{"class":141,"line":192},3,[194,198,202,208],{"type":17,"tag":139,"props":195,"children":196},{"style":146},[197],{"type":23,"value":149},{"type":17,"tag":139,"props":199,"children":200},{"style":152},[201],{"type":23,"value":155},{"type":17,"tag":139,"props":203,"children":205},{"style":204},"--shiki-default:#24292E",[206],{"type":23,"value":207}," [--SCOPE] KEY VALUE  ",{"type":17,"tag":139,"props":209,"children":210},{"style":164},[211],{"type":23,"value":212},"# 设置\u002F更新配置项 KEY 的值\n",{"type":17,"tag":214,"props":215,"children":217},"h4",{"id":216},"配置范围-scope",[218],{"type":23,"value":219},"配置范围 SCOPE",{"type":17,"tag":25,"props":221,"children":222},{},[223,228,238,248],{"type":17,"tag":29,"props":224,"children":225},{},[226],{"type":23,"value":227},"worktree：仅对当前工作树生效",{"type":17,"tag":29,"props":229,"children":230},{},[231,236],{"type":17,"tag":66,"props":232,"children":233},{},[234],{"type":23,"value":235},"local",{"type":23,"value":237},"：【常见】【默认】仅对当前仓库有效",{"type":17,"tag":29,"props":239,"children":240},{},[241,246],{"type":17,"tag":66,"props":242,"children":243},{},[244],{"type":23,"value":245},"global",{"type":23,"value":247},"：【常见】对当前用户的所有仓库有效",{"type":17,"tag":29,"props":249,"children":250},{},[251],{"type":23,"value":252},"system：对所有用户有效",{"type":17,"tag":254,"props":255,"children":256},"p",{},[257,259,263,265,269],{"type":23,"value":258},"优先级从到到低：worktree > ",{"type":17,"tag":66,"props":260,"children":261},{},[262],{"type":23,"value":235},{"type":23,"value":264}," > ",{"type":17,"tag":66,"props":266,"children":267},{},[268],{"type":23,"value":245},{"type":23,"value":270}," > system",{"type":17,"tag":214,"props":272,"children":274},{"id":273},"常见配置",[275],{"type":23,"value":273},{"type":17,"tag":25,"props":277,"children":278},{},[279,289,299,307,317,335],{"type":17,"tag":29,"props":280,"children":281},{},[282,287],{"type":17,"tag":66,"props":283,"children":284},{},[285],{"type":23,"value":286},"user.name",{"type":23,"value":288},"：【必配】配置用户名。后续提交会使用该用户名",{"type":17,"tag":29,"props":290,"children":291},{},[292,297],{"type":17,"tag":66,"props":293,"children":294},{},[295],{"type":23,"value":296},"user.email",{"type":23,"value":298},"：【必配】配置邮箱。后续提交会使用该邮箱",{"type":17,"tag":29,"props":300,"children":301},{},[302,306],{"type":17,"tag":66,"props":303,"children":304},{},[305],{"type":23,"value":286},{"type":23,"value":288},{"type":17,"tag":29,"props":308,"children":309},{},[310,315],{"type":17,"tag":66,"props":311,"children":312},{},[313],{"type":23,"value":314},"core.editor",{"type":23,"value":316},"：配置默认的文本编辑器",{"type":17,"tag":29,"props":318,"children":319},{},[320,325,327,333],{"type":17,"tag":66,"props":321,"children":322},{},[323],{"type":23,"value":324},"core.ignorecase",{"type":23,"value":326},"：配置是否忽略文件名的大小写，默认是 ",{"type":17,"tag":110,"props":328,"children":330},{"className":329},[],[331],{"type":23,"value":332},"true",{"type":23,"value":334},"，即忽略大小写",{"type":17,"tag":29,"props":336,"children":337},{},[338,343],{"type":17,"tag":66,"props":339,"children":340},{},[341],{"type":23,"value":342},"init.defaultbranch",{"type":23,"value":344},"：配置初始化后的默认分支名",{"type":17,"tag":129,"props":346,"children":348},{"code":347,"language":132,"meta":7,"className":133,"style":7},"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",[349],{"type":17,"tag":110,"props":350,"children":351},{"__ignoreMap":7},[352,378,403,428,454],{"type":17,"tag":139,"props":353,"children":354},{"class":141,"line":142},[355,359,363,368,373],{"type":17,"tag":139,"props":356,"children":357},{"style":146},[358],{"type":23,"value":149},{"type":17,"tag":139,"props":360,"children":361},{"style":152},[362],{"type":23,"value":155},{"type":17,"tag":139,"props":364,"children":365},{"style":158},[366],{"type":23,"value":367}," --global",{"type":17,"tag":139,"props":369,"children":370},{"style":152},[371],{"type":23,"value":372}," user.name",{"type":17,"tag":139,"props":374,"children":375},{"style":152},[376],{"type":23,"value":377}," \"wangchong1118\"\n",{"type":17,"tag":139,"props":379,"children":380},{"class":141,"line":170},[381,385,389,393,398],{"type":17,"tag":139,"props":382,"children":383},{"style":146},[384],{"type":23,"value":149},{"type":17,"tag":139,"props":386,"children":387},{"style":152},[388],{"type":23,"value":155},{"type":17,"tag":139,"props":390,"children":391},{"style":158},[392],{"type":23,"value":367},{"type":17,"tag":139,"props":394,"children":395},{"style":152},[396],{"type":23,"value":397}," user.email",{"type":17,"tag":139,"props":399,"children":400},{"style":152},[401],{"type":23,"value":402}," \"wangchong1118@126.com\"\n",{"type":17,"tag":139,"props":404,"children":405},{"class":141,"line":192},[406,410,414,418,423],{"type":17,"tag":139,"props":407,"children":408},{"style":146},[409],{"type":23,"value":149},{"type":17,"tag":139,"props":411,"children":412},{"style":152},[413],{"type":23,"value":155},{"type":17,"tag":139,"props":415,"children":416},{"style":158},[417],{"type":23,"value":367},{"type":17,"tag":139,"props":419,"children":420},{"style":152},[421],{"type":23,"value":422}," core.editor",{"type":17,"tag":139,"props":424,"children":425},{"style":152},[426],{"type":23,"value":427}," \"code\"\n",{"type":17,"tag":139,"props":429,"children":431},{"class":141,"line":430},4,[432,436,440,444,449],{"type":17,"tag":139,"props":433,"children":434},{"style":146},[435],{"type":23,"value":149},{"type":17,"tag":139,"props":437,"children":438},{"style":152},[439],{"type":23,"value":155},{"type":17,"tag":139,"props":441,"children":442},{"style":158},[443],{"type":23,"value":367},{"type":17,"tag":139,"props":445,"children":446},{"style":152},[447],{"type":23,"value":448}," core.ignorecase",{"type":17,"tag":139,"props":450,"children":451},{"style":158},[452],{"type":23,"value":453}," false\n",{"type":17,"tag":139,"props":455,"children":457},{"class":141,"line":456},5,[458,462,466,470,475],{"type":17,"tag":139,"props":459,"children":460},{"style":146},[461],{"type":23,"value":149},{"type":17,"tag":139,"props":463,"children":464},{"style":152},[465],{"type":23,"value":155},{"type":17,"tag":139,"props":467,"children":468},{"style":158},[469],{"type":23,"value":367},{"type":17,"tag":139,"props":471,"children":472},{"style":152},[473],{"type":23,"value":474}," init.defaultbranch",{"type":17,"tag":139,"props":476,"children":477},{"style":152},[478],{"type":23,"value":479}," \"main\"\n",{"type":17,"tag":18,"props":481,"children":483},{"id":482},"初始化",[484],{"type":23,"value":482},{"type":17,"tag":254,"props":486,"children":487},{},[488],{"type":23,"value":489},"要对一个目录使用 git 进行版本管理，必须先将该目录设置为 git 仓库",{"type":17,"tag":254,"props":491,"children":492},{},[493,495,501],{"type":23,"value":494},"使用 ",{"type":17,"tag":110,"props":496,"children":498},{"className":497},[],[499],{"type":23,"value":500},"git init",{"type":23,"value":502}," 命令初始化一个新的 git 仓库",{"type":17,"tag":254,"props":504,"children":505},{},[506,508,514],{"type":23,"value":507},"该命令会在当前目录下创建一个 ",{"type":17,"tag":110,"props":509,"children":511},{"className":510},[],[512],{"type":23,"value":513},".git",{"type":23,"value":515}," 目录，该目录就是 git 仓库，里面记录了仓库的所有信息。该目录不可删除，一旦删除，该仓库就不存在了",{"type":17,"tag":18,"props":517,"children":519},{"id":518},"项目忽略文件-gitignore",[520],{"type":23,"value":521},"项目忽略文件 .gitignore",{"type":17,"tag":254,"props":523,"children":524},{},[525,527,533],{"type":23,"value":526},"仓库中某些文件是「个人专属」不需要的文件排除，不会在团队间共享，可以使用 ",{"type":17,"tag":110,"props":528,"children":530},{"className":529},[],[531],{"type":23,"value":532},".gitignore",{"type":23,"value":534}," 文件将不需要的文件在提交仓库是自动排除掉",{"type":17,"tag":18,"props":536,"children":538},{"id":537},"提交",[539],{"type":23,"value":537},{"type":17,"tag":254,"props":541,"children":542},{},[543],{"type":23,"value":544},"每一次提交就相当于将当前目录下的所有文件进行「拍照」，「照片」会保存在 git 仓库中",{"type":17,"tag":254,"props":546,"children":547},{},[548],{"type":23,"value":549},"「拍照」的主要目的，是为了将来可以在不同的「照片」之间进行比较和恢复",{"type":17,"tag":551,"props":552,"children":553},"blockquote",{},[554],{"type":17,"tag":254,"props":555,"children":556},{},[557,559,565],{"type":23,"value":558},"「照片」的具体位置在 ",{"type":17,"tag":110,"props":560,"children":562},{"className":561},[],[563],{"type":23,"value":564},".git\u002Fobjects",{"type":23,"value":566}," 的目录下",{"type":17,"tag":214,"props":568,"children":570},{"id":569},"如何提交",[571],{"type":23,"value":569},{"type":17,"tag":254,"props":573,"children":574},{},[575],{"type":23,"value":576},"提交分为两步：",{"type":17,"tag":578,"props":579,"children":580},"ol",{},[581],{"type":17,"tag":29,"props":582,"children":583},{},[584],{"type":23,"value":585},"【可选】查看当前 git 状态",{"type":17,"tag":129,"props":587,"children":589},{"code":588,"language":132,"meta":7,"className":133,"style":7},"git status\n",[590],{"type":17,"tag":110,"props":591,"children":592},{"__ignoreMap":7},[593],{"type":17,"tag":139,"props":594,"children":595},{"class":141,"line":142},[596,600],{"type":17,"tag":139,"props":597,"children":598},{"style":146},[599],{"type":23,"value":149},{"type":17,"tag":139,"props":601,"children":602},{"style":152},[603],{"type":23,"value":604}," status\n",{"type":17,"tag":578,"props":606,"children":607},{"start":170},[608],{"type":17,"tag":29,"props":609,"children":610},{},[611],{"type":23,"value":612},"将更新的文件暂存起来",{"type":17,"tag":129,"props":614,"children":616},{"code":615,"language":132,"meta":7,"className":133,"style":7},"git add \u003Cfile1> \u003Cfile2>     # 暂存指定的文件\ngit add .                   # 暂存当前项目目录及子目录下的所有文件\n",[617],{"type":17,"tag":110,"props":618,"children":619},{"__ignoreMap":7},[620,666],{"type":17,"tag":139,"props":621,"children":622},{"class":141,"line":142},[623,627,632,638,643,648,652,656,661],{"type":17,"tag":139,"props":624,"children":625},{"style":146},[626],{"type":23,"value":149},{"type":17,"tag":139,"props":628,"children":629},{"style":152},[630],{"type":23,"value":631}," add",{"type":17,"tag":139,"props":633,"children":635},{"style":634},"--shiki-default:#D73A49",[636],{"type":23,"value":637}," \u003C",{"type":17,"tag":139,"props":639,"children":640},{"style":152},[641],{"type":23,"value":642},"file",{"type":17,"tag":139,"props":644,"children":645},{"style":634},[646],{"type":23,"value":647},"1>",{"type":17,"tag":139,"props":649,"children":650},{"style":634},[651],{"type":23,"value":637},{"type":17,"tag":139,"props":653,"children":654},{"style":152},[655],{"type":23,"value":642},{"type":17,"tag":139,"props":657,"children":658},{"style":634},[659],{"type":23,"value":660},"2>",{"type":17,"tag":139,"props":662,"children":663},{"style":164},[664],{"type":23,"value":665},"     # 暂存指定的文件\n",{"type":17,"tag":139,"props":667,"children":668},{"class":141,"line":170},[669,673,677,682],{"type":17,"tag":139,"props":670,"children":671},{"style":146},[672],{"type":23,"value":149},{"type":17,"tag":139,"props":674,"children":675},{"style":152},[676],{"type":23,"value":631},{"type":17,"tag":139,"props":678,"children":679},{"style":152},[680],{"type":23,"value":681}," .",{"type":17,"tag":139,"props":683,"children":684},{"style":164},[685],{"type":23,"value":686},"                   # 暂存当前项目目录及子目录下的所有文件\n",{"type":17,"tag":578,"props":688,"children":689},{"start":192},[690],{"type":17,"tag":29,"props":691,"children":692},{},[693],{"type":23,"value":694},"将暂存的内容一起提交",{"type":17,"tag":129,"props":696,"children":698},{"code":697,"language":132,"meta":7,"className":133,"style":7},"git commit # 会自动打开默认的文本编辑器，在编辑器中编写提交信息，保存后自动完成提交\ngit commit -m \"提交信息\"        # 直接在命令行中直接编写提交信息，直接完成提交，不打开文本编辑器\n",[699],{"type":17,"tag":110,"props":700,"children":701},{"__ignoreMap":7},[702,719],{"type":17,"tag":139,"props":703,"children":704},{"class":141,"line":142},[705,709,714],{"type":17,"tag":139,"props":706,"children":707},{"style":146},[708],{"type":23,"value":149},{"type":17,"tag":139,"props":710,"children":711},{"style":152},[712],{"type":23,"value":713}," commit",{"type":17,"tag":139,"props":715,"children":716},{"style":164},[717],{"type":23,"value":718}," # 会自动打开默认的文本编辑器，在编辑器中编写提交信息，保存后自动完成提交\n",{"type":17,"tag":139,"props":720,"children":721},{"class":141,"line":170},[722,726,730,735,740],{"type":17,"tag":139,"props":723,"children":724},{"style":146},[725],{"type":23,"value":149},{"type":17,"tag":139,"props":727,"children":728},{"style":152},[729],{"type":23,"value":713},{"type":17,"tag":139,"props":731,"children":732},{"style":158},[733],{"type":23,"value":734}," -m",{"type":17,"tag":139,"props":736,"children":737},{"style":152},[738],{"type":23,"value":739}," \"提交信息\"",{"type":17,"tag":139,"props":741,"children":742},{"style":164},[743],{"type":23,"value":744},"        # 直接在命令行中直接编写提交信息，直接完成提交，不打开文本编辑器\n",{"type":17,"tag":254,"props":746,"children":747},{},[748,753],{"type":17,"tag":66,"props":749,"children":750},{},[751],{"type":23,"value":752},"术语",{"type":23,"value":754},"：",{"type":17,"tag":25,"props":756,"children":757},{},[758,768],{"type":17,"tag":29,"props":759,"children":760},{},[761,766],{"type":17,"tag":66,"props":762,"children":763},{},[764],{"type":23,"value":765},"工作区",{"type":23,"value":767},"：真实的工作文件",{"type":17,"tag":29,"props":769,"children":770},{},[771,776,777,783],{"type":17,"tag":66,"props":772,"children":773},{},[774],{"type":23,"value":775},"暂存区",{"type":23,"value":754},{"type":17,"tag":110,"props":778,"children":780},{"className":779},[],[781],{"type":23,"value":782},"git add",{"type":23,"value":784}," 命令暂存起来的文件",{"type":17,"tag":214,"props":786,"children":788},{"id":787},"提交信息编写规范",[789],{"type":23,"value":787},{"type":17,"tag":791,"props":792,"children":793},"table",{},[794,823],{"type":17,"tag":795,"props":796,"children":797},"thead",{},[798],{"type":17,"tag":799,"props":800,"children":801},"tr",{},[802,808,813,818],{"type":17,"tag":803,"props":804,"children":805},"th",{},[806],{"type":23,"value":807},"提交类型",{"type":17,"tag":803,"props":809,"children":810},{},[811],{"type":23,"value":812},"标识符",{"type":17,"tag":803,"props":814,"children":815},{},[816],{"type":23,"value":817},"说明",{"type":17,"tag":803,"props":819,"children":820},{},[821],{"type":23,"value":822},"示例",{"type":17,"tag":824,"props":825,"children":826},"tbody",{},[827,854,880,906,929,952,975,998,1021,1044,1067],{"type":17,"tag":799,"props":828,"children":829},{},[830,839,844,849],{"type":17,"tag":831,"props":832,"children":833},"td",{},[834],{"type":17,"tag":66,"props":835,"children":836},{},[837],{"type":23,"value":838},"功能新增",{"type":17,"tag":831,"props":840,"children":841},{},[842],{"type":23,"value":843},"feat",{"type":17,"tag":831,"props":845,"children":846},{},[847],{"type":23,"value":848},"新增功能或特性",{"type":17,"tag":831,"props":850,"children":851},{},[852],{"type":23,"value":853},"feat: 添加用户登录功能",{"type":17,"tag":799,"props":855,"children":856},{},[857,865,870,875],{"type":17,"tag":831,"props":858,"children":859},{},[860],{"type":17,"tag":66,"props":861,"children":862},{},[863],{"type":23,"value":864},"问题修复",{"type":17,"tag":831,"props":866,"children":867},{},[868],{"type":23,"value":869},"fix",{"type":17,"tag":831,"props":871,"children":872},{},[873],{"type":23,"value":874},"修复bug或问题",{"type":17,"tag":831,"props":876,"children":877},{},[878],{"type":23,"value":879},"fix: 修复登录超时问题",{"type":17,"tag":799,"props":881,"children":882},{},[883,891,896,901],{"type":17,"tag":831,"props":884,"children":885},{},[886],{"type":17,"tag":66,"props":887,"children":888},{},[889],{"type":23,"value":890},"文档更新",{"type":17,"tag":831,"props":892,"children":893},{},[894],{"type":23,"value":895},"docs",{"type":17,"tag":831,"props":897,"children":898},{},[899],{"type":23,"value":900},"仅文档变更",{"type":17,"tag":831,"props":902,"children":903},{},[904],{"type":23,"value":905},"docs: 更新API使用说明",{"type":17,"tag":799,"props":907,"children":908},{},[909,914,919,924],{"type":17,"tag":831,"props":910,"children":911},{},[912],{"type":23,"value":913},"代码风格",{"type":17,"tag":831,"props":915,"children":916},{},[917],{"type":23,"value":918},"style",{"type":17,"tag":831,"props":920,"children":921},{},[922],{"type":23,"value":923},"代码格式调整(不影响功能)",{"type":17,"tag":831,"props":925,"children":926},{},[927],{"type":23,"value":928},"style:调整代码缩进格式",{"type":17,"tag":799,"props":930,"children":931},{},[932,937,942,947],{"type":17,"tag":831,"props":933,"children":934},{},[935],{"type":23,"value":936},"代码重构",{"type":17,"tag":831,"props":938,"children":939},{},[940],{"type":23,"value":941},"refactor",{"type":17,"tag":831,"props":943,"children":944},{},[945],{"type":23,"value":946},"代码重构（非功能变更）",{"type":17,"tag":831,"props":948,"children":949},{},[950],{"type":23,"value":951},"refactor: 重构用户认证模块",{"type":17,"tag":799,"props":953,"children":954},{},[955,960,965,970],{"type":17,"tag":831,"props":956,"children":957},{},[958],{"type":23,"value":959},"性能优化",{"type":17,"tag":831,"props":961,"children":962},{},[963],{"type":23,"value":964},"perf",{"type":17,"tag":831,"props":966,"children":967},{},[968],{"type":23,"value":969},"性能优化相关",{"type":17,"tag":831,"props":971,"children":972},{},[973],{"type":23,"value":974},"perf: 优化数据库查询性能",{"type":17,"tag":799,"props":976,"children":977},{},[978,983,988,993],{"type":17,"tag":831,"props":979,"children":980},{},[981],{"type":23,"value":982},"测试相关",{"type":17,"tag":831,"props":984,"children":985},{},[986],{"type":23,"value":987},"test",{"type":17,"tag":831,"props":989,"children":990},{},[991],{"type":23,"value":992},"测试用例相关",{"type":17,"tag":831,"props":994,"children":995},{},[996],{"type":23,"value":997},"test：添加登录功能单元测试",{"type":17,"tag":799,"props":999,"children":1000},{},[1001,1006,1011,1016],{"type":17,"tag":831,"props":1002,"children":1003},{},[1004],{"type":23,"value":1005},"构建系统",{"type":17,"tag":831,"props":1007,"children":1008},{},[1009],{"type":23,"value":1010},"build",{"type":17,"tag":831,"props":1012,"children":1013},{},[1014],{"type":23,"value":1015},"构建系统或外部依赖变更",{"type":17,"tag":831,"props":1017,"children":1018},{},[1019],{"type":23,"value":1020},"build: 更新 webpack 配置",{"type":17,"tag":799,"props":1022,"children":1023},{},[1024,1029,1034,1039],{"type":17,"tag":831,"props":1025,"children":1026},{},[1027],{"type":23,"value":1028},"持续集成",{"type":17,"tag":831,"props":1030,"children":1031},{},[1032],{"type":23,"value":1033},"ci",{"type":17,"tag":831,"props":1035,"children":1036},{},[1037],{"type":23,"value":1038},"CI\u002FCD配置变更",{"type":17,"tag":831,"props":1040,"children":1041},{},[1042],{"type":23,"value":1043},"ci: 添加 GitHub Actions 工作流",{"type":17,"tag":799,"props":1045,"children":1046},{},[1047,1052,1057,1062],{"type":17,"tag":831,"props":1048,"children":1049},{},[1050],{"type":23,"value":1051},"工具变更",{"type":17,"tag":831,"props":1053,"children":1054},{},[1055],{"type":23,"value":1056},"chore",{"type":17,"tag":831,"props":1058,"children":1059},{},[1060],{"type":23,"value":1061},"构建过程或辅助工具变更",{"type":17,"tag":831,"props":1063,"children":1064},{},[1065],{"type":23,"value":1066},"chore: 更新依赖包版本",{"type":17,"tag":799,"props":1068,"children":1069},{},[1070,1075,1080,1085],{"type":17,"tag":831,"props":1071,"children":1072},{},[1073],{"type":23,"value":1074},"回滚操作",{"type":17,"tag":831,"props":1076,"children":1077},{},[1078],{"type":23,"value":1079},"revert",{"type":17,"tag":831,"props":1081,"children":1082},{},[1083],{"type":23,"value":1084},"回滚之前的提交",{"type":17,"tag":831,"props":1086,"children":1087},{},[1088],{"type":23,"value":1089},"revert: 回滚错误的合并提交",{"type":17,"tag":214,"props":1091,"children":1093},{"id":1092},"提交信息修改",[1094],{"type":23,"value":1092},{"type":17,"tag":129,"props":1096,"children":1098},{"code":1097,"language":132,"meta":7,"className":133,"style":7},"git commit -amend\n",[1099],{"type":17,"tag":110,"props":1100,"children":1101},{"__ignoreMap":7},[1102],{"type":17,"tag":139,"props":1103,"children":1104},{"class":141,"line":142},[1105,1109,1113],{"type":17,"tag":139,"props":1106,"children":1107},{"style":146},[1108],{"type":23,"value":149},{"type":17,"tag":139,"props":1110,"children":1111},{"style":152},[1112],{"type":23,"value":713},{"type":17,"tag":139,"props":1114,"children":1115},{"style":158},[1116],{"type":23,"value":1117}," -amend\n",{"type":17,"tag":254,"props":1119,"children":1120},{},[1121],{"type":23,"value":1122},"该命令通常用于修改最新的提交消息",{"type":17,"tag":254,"props":1124,"children":1125},{},[1126],{"type":23,"value":1127},"所以使用该命令时，要确保自己所在的位置在最新的位置",{"type":17,"tag":551,"props":1129,"children":1130},{},[1131,1136,1149],{"type":17,"tag":254,"props":1132,"children":1133},{},[1134],{"type":23,"value":1135},"最佳实践 1：",{"type":17,"tag":578,"props":1137,"children":1138},{},[1139,1144],{"type":17,"tag":29,"props":1140,"children":1141},{},[1142],{"type":23,"value":1143},"编与提交消息时，尽量不要犯错",{"type":17,"tag":29,"props":1145,"children":1146},{},[1147],{"type":23,"value":1148},"提交后，立即审核提交消息，发现消息错误，立即通过上面的命令修复",{"type":17,"tag":254,"props":1150,"children":1151},{},[1152],{"type":23,"value":1153},"最佳实践 2：让 AI 编写提交消息，审核后发布",{"type":17,"tag":214,"props":1155,"children":1157},{"id":1156},"回滚某个提交",[1158],{"type":23,"value":1156},{"type":17,"tag":129,"props":1160,"children":1162},{"code":1161,"language":132,"meta":7,"className":133,"style":7},"git restore --source COMMIT_ID .    # 将指定的提交覆盖到当前项目工作区\n",[1163],{"type":17,"tag":110,"props":1164,"children":1165},{"__ignoreMap":7},[1166],{"type":17,"tag":139,"props":1167,"children":1168},{"class":141,"line":142},[1169,1173,1178,1183,1188,1192],{"type":17,"tag":139,"props":1170,"children":1171},{"style":146},[1172],{"type":23,"value":149},{"type":17,"tag":139,"props":1174,"children":1175},{"style":152},[1176],{"type":23,"value":1177}," restore",{"type":17,"tag":139,"props":1179,"children":1180},{"style":158},[1181],{"type":23,"value":1182}," --source",{"type":17,"tag":139,"props":1184,"children":1185},{"style":152},[1186],{"type":23,"value":1187}," COMMIT_ID",{"type":17,"tag":139,"props":1189,"children":1190},{"style":152},[1191],{"type":23,"value":681},{"type":17,"tag":139,"props":1193,"children":1194},{"style":164},[1195],{"type":23,"value":1196},"    # 将指定的提交覆盖到当前项目工作区\n",{"type":17,"tag":254,"props":1198,"children":1199},{},[1200],{"type":23,"value":1201},"使用上述命令时，要确保工作区干净（暂存区没东西，工作区无更改）",{"type":17,"tag":254,"props":1203,"children":1204},{},[1205],{"type":23,"value":1206},"工作区如果不干净怎么办？（暂存区没东西或者工作区有更改）",{"type":17,"tag":578,"props":1208,"children":1209},{},[1210],{"type":17,"tag":29,"props":1211,"children":1212},{},[1213],{"type":23,"value":1214},"先把目前状态保存到存储库",{"type":17,"tag":129,"props":1216,"children":1218},{"code":1217,"language":132,"meta":7,"className":133,"style":7},"git stash push -u -a\n",[1219],{"type":17,"tag":110,"props":1220,"children":1221},{"__ignoreMap":7},[1222],{"type":17,"tag":139,"props":1223,"children":1224},{"class":141,"line":142},[1225,1229,1234,1239,1244],{"type":17,"tag":139,"props":1226,"children":1227},{"style":146},[1228],{"type":23,"value":149},{"type":17,"tag":139,"props":1230,"children":1231},{"style":152},[1232],{"type":23,"value":1233}," stash",{"type":17,"tag":139,"props":1235,"children":1236},{"style":152},[1237],{"type":23,"value":1238}," push",{"type":17,"tag":139,"props":1240,"children":1241},{"style":158},[1242],{"type":23,"value":1243}," -u",{"type":17,"tag":139,"props":1245,"children":1246},{"style":158},[1247],{"type":23,"value":1248}," -a\n",{"type":17,"tag":578,"props":1250,"children":1251},{"start":170},[1252,1257],{"type":17,"tag":29,"props":1253,"children":1254},{},[1255],{"type":23,"value":1256},"工作区干净了，就可以做任何其他的事情",{"type":17,"tag":29,"props":1258,"children":1259},{},[1260],{"type":23,"value":1261},"如果要恢复工作区",{"type":17,"tag":129,"props":1263,"children":1265},{"code":1264,"language":132,"meta":7,"className":133,"style":7},"git stash list  # 【可选】列出所有的存储\ngit stash pop   # 恢复上一次的存储，同时删除上一次的存储\ngit stash pop \u003CSTASH_ID> # 恢复到指定ID的存储，同时删除该存储\n",[1266],{"type":17,"tag":110,"props":1267,"children":1268},{"__ignoreMap":7},[1269,1290,1311],{"type":17,"tag":139,"props":1270,"children":1271},{"class":141,"line":142},[1272,1276,1280,1285],{"type":17,"tag":139,"props":1273,"children":1274},{"style":146},[1275],{"type":23,"value":149},{"type":17,"tag":139,"props":1277,"children":1278},{"style":152},[1279],{"type":23,"value":1233},{"type":17,"tag":139,"props":1281,"children":1282},{"style":152},[1283],{"type":23,"value":1284}," list",{"type":17,"tag":139,"props":1286,"children":1287},{"style":164},[1288],{"type":23,"value":1289},"  # 【可选】列出所有的存储\n",{"type":17,"tag":139,"props":1291,"children":1292},{"class":141,"line":170},[1293,1297,1301,1306],{"type":17,"tag":139,"props":1294,"children":1295},{"style":146},[1296],{"type":23,"value":149},{"type":17,"tag":139,"props":1298,"children":1299},{"style":152},[1300],{"type":23,"value":1233},{"type":17,"tag":139,"props":1302,"children":1303},{"style":152},[1304],{"type":23,"value":1305}," pop",{"type":17,"tag":139,"props":1307,"children":1308},{"style":164},[1309],{"type":23,"value":1310},"   # 恢复上一次的存储，同时删除上一次的存储\n",{"type":17,"tag":139,"props":1312,"children":1313},{"class":141,"line":192},[1314,1318,1322,1326,1330,1335,1340,1345],{"type":17,"tag":139,"props":1315,"children":1316},{"style":146},[1317],{"type":23,"value":149},{"type":17,"tag":139,"props":1319,"children":1320},{"style":152},[1321],{"type":23,"value":1233},{"type":17,"tag":139,"props":1323,"children":1324},{"style":152},[1325],{"type":23,"value":1305},{"type":17,"tag":139,"props":1327,"children":1328},{"style":634},[1329],{"type":23,"value":637},{"type":17,"tag":139,"props":1331,"children":1332},{"style":152},[1333],{"type":23,"value":1334},"STASH_I",{"type":17,"tag":139,"props":1336,"children":1337},{"style":204},[1338],{"type":23,"value":1339},"D",{"type":17,"tag":139,"props":1341,"children":1342},{"style":634},[1343],{"type":23,"value":1344},">",{"type":17,"tag":139,"props":1346,"children":1347},{"style":164},[1348],{"type":23,"value":1349}," # 恢复到指定ID的存储，同时删除该存储\n",{"type":17,"tag":18,"props":1351,"children":1353},{"id":1352},"分支",[1354],{"type":23,"value":1352},{"type":17,"tag":254,"props":1356,"children":1357},{},[1358],{"type":23,"value":1359},"牢记一下两点：",{"type":17,"tag":25,"props":1361,"children":1362},{},[1363,1368],{"type":17,"tag":29,"props":1364,"children":1365},{},[1366],{"type":23,"value":1367},"分支是一个指针，指向一个快照",{"type":17,"tag":29,"props":1369,"children":1370},{},[1371],{"type":23,"value":1372},"HEAD 是一个指针，指向一个分支",{"type":17,"tag":129,"props":1374,"children":1376},{"code":1375},"提交 1 --> 提交 2 --> 提交 3\n\n分支 1 --> 提交 3\nHEAD --> 分支 1\n",[1377],{"type":17,"tag":110,"props":1378,"children":1379},{"__ignoreMap":7},[1380],{"type":23,"value":1375},{"type":17,"tag":254,"props":1382,"children":1383},{},[1384],{"type":23,"value":1385},"简化后",{"type":17,"tag":129,"props":1387,"children":1389},{"code":1388},"提交 1 --> 提交 2 --> 提交 3 (*分支 1)\n",[1390],{"type":17,"tag":110,"props":1391,"children":1392},{"__ignoreMap":7},[1393],{"type":23,"value":1388},{"type":17,"tag":214,"props":1395,"children":1397},{"id":1396},"分支管理",[1398],{"type":23,"value":1396},{"type":17,"tag":254,"props":1400,"children":1401},{},[1402],{"type":23,"value":1403},"分支基本操作：",{"type":17,"tag":578,"props":1405,"children":1406},{},[1407],{"type":17,"tag":29,"props":1408,"children":1409},{},[1410],{"type":23,"value":1411},"查看分支",{"type":17,"tag":129,"props":1413,"children":1415},{"code":1414,"language":132,"meta":7,"className":133,"style":7},"git branch\n",[1416],{"type":17,"tag":110,"props":1417,"children":1418},{"__ignoreMap":7},[1419],{"type":17,"tag":139,"props":1420,"children":1421},{"class":141,"line":142},[1422,1426],{"type":17,"tag":139,"props":1423,"children":1424},{"style":146},[1425],{"type":23,"value":149},{"type":17,"tag":139,"props":1427,"children":1428},{"style":152},[1429],{"type":23,"value":1430}," branch\n",{"type":17,"tag":578,"props":1432,"children":1433},{"start":170},[1434],{"type":17,"tag":29,"props":1435,"children":1436},{},[1437],{"type":23,"value":1438},"分支重命名",{"type":17,"tag":129,"props":1440,"children":1442},{"code":1441,"language":132,"meta":7,"className":133,"style":7},"git branch -m \u003Cnew-name>                # 重命名当前分支\ngit branch -m \u003Cold-name> \u003Cnew-name>     # 重命名指定分支\n",[1443],{"type":17,"tag":110,"props":1444,"children":1445},{"__ignoreMap":7},[1446,1485],{"type":17,"tag":139,"props":1447,"children":1448},{"class":141,"line":142},[1449,1453,1458,1462,1466,1471,1476,1480],{"type":17,"tag":139,"props":1450,"children":1451},{"style":146},[1452],{"type":23,"value":149},{"type":17,"tag":139,"props":1454,"children":1455},{"style":152},[1456],{"type":23,"value":1457}," branch",{"type":17,"tag":139,"props":1459,"children":1460},{"style":158},[1461],{"type":23,"value":734},{"type":17,"tag":139,"props":1463,"children":1464},{"style":634},[1465],{"type":23,"value":637},{"type":17,"tag":139,"props":1467,"children":1468},{"style":152},[1469],{"type":23,"value":1470},"new-nam",{"type":17,"tag":139,"props":1472,"children":1473},{"style":204},[1474],{"type":23,"value":1475},"e",{"type":17,"tag":139,"props":1477,"children":1478},{"style":634},[1479],{"type":23,"value":1344},{"type":17,"tag":139,"props":1481,"children":1482},{"style":164},[1483],{"type":23,"value":1484},"                # 重命名当前分支\n",{"type":17,"tag":139,"props":1486,"children":1487},{"class":141,"line":170},[1488,1492,1496,1500,1504,1509,1513,1517,1521,1525,1529,1533],{"type":17,"tag":139,"props":1489,"children":1490},{"style":146},[1491],{"type":23,"value":149},{"type":17,"tag":139,"props":1493,"children":1494},{"style":152},[1495],{"type":23,"value":1457},{"type":17,"tag":139,"props":1497,"children":1498},{"style":158},[1499],{"type":23,"value":734},{"type":17,"tag":139,"props":1501,"children":1502},{"style":634},[1503],{"type":23,"value":637},{"type":17,"tag":139,"props":1505,"children":1506},{"style":152},[1507],{"type":23,"value":1508},"old-nam",{"type":17,"tag":139,"props":1510,"children":1511},{"style":204},[1512],{"type":23,"value":1475},{"type":17,"tag":139,"props":1514,"children":1515},{"style":634},[1516],{"type":23,"value":1344},{"type":17,"tag":139,"props":1518,"children":1519},{"style":634},[1520],{"type":23,"value":637},{"type":17,"tag":139,"props":1522,"children":1523},{"style":152},[1524],{"type":23,"value":1470},{"type":17,"tag":139,"props":1526,"children":1527},{"style":204},[1528],{"type":23,"value":1475},{"type":17,"tag":139,"props":1530,"children":1531},{"style":634},[1532],{"type":23,"value":1344},{"type":17,"tag":139,"props":1534,"children":1535},{"style":164},[1536],{"type":23,"value":1537},"     # 重命名指定分支\n",{"type":17,"tag":578,"props":1539,"children":1540},{"start":192},[1541],{"type":17,"tag":29,"props":1542,"children":1543},{},[1544],{"type":23,"value":1545},"创建分支",{"type":17,"tag":129,"props":1547,"children":1549},{"code":1548,"language":132,"meta":7,"className":133,"style":7},"git branch \u003Cbranch-name>                # 创建一个新的分支，指针和当前分支相同\ngit branch \u003Cbranch-name> \u003Ccommit-hash>  # 创建一个新的分支，指针指向指定的提交\n",[1550],{"type":17,"tag":110,"props":1551,"children":1552},{"__ignoreMap":7},[1553,1586],{"type":17,"tag":139,"props":1554,"children":1555},{"class":141,"line":142},[1556,1560,1564,1568,1573,1577,1581],{"type":17,"tag":139,"props":1557,"children":1558},{"style":146},[1559],{"type":23,"value":149},{"type":17,"tag":139,"props":1561,"children":1562},{"style":152},[1563],{"type":23,"value":1457},{"type":17,"tag":139,"props":1565,"children":1566},{"style":634},[1567],{"type":23,"value":637},{"type":17,"tag":139,"props":1569,"children":1570},{"style":152},[1571],{"type":23,"value":1572},"branch-nam",{"type":17,"tag":139,"props":1574,"children":1575},{"style":204},[1576],{"type":23,"value":1475},{"type":17,"tag":139,"props":1578,"children":1579},{"style":634},[1580],{"type":23,"value":1344},{"type":17,"tag":139,"props":1582,"children":1583},{"style":164},[1584],{"type":23,"value":1585},"                # 创建一个新的分支，指针和当前分支相同\n",{"type":17,"tag":139,"props":1587,"children":1588},{"class":141,"line":170},[1589,1593,1597,1601,1605,1609,1613,1617,1622,1627,1631],{"type":17,"tag":139,"props":1590,"children":1591},{"style":146},[1592],{"type":23,"value":149},{"type":17,"tag":139,"props":1594,"children":1595},{"style":152},[1596],{"type":23,"value":1457},{"type":17,"tag":139,"props":1598,"children":1599},{"style":634},[1600],{"type":23,"value":637},{"type":17,"tag":139,"props":1602,"children":1603},{"style":152},[1604],{"type":23,"value":1572},{"type":17,"tag":139,"props":1606,"children":1607},{"style":204},[1608],{"type":23,"value":1475},{"type":17,"tag":139,"props":1610,"children":1611},{"style":634},[1612],{"type":23,"value":1344},{"type":17,"tag":139,"props":1614,"children":1615},{"style":634},[1616],{"type":23,"value":637},{"type":17,"tag":139,"props":1618,"children":1619},{"style":152},[1620],{"type":23,"value":1621},"commit-has",{"type":17,"tag":139,"props":1623,"children":1624},{"style":204},[1625],{"type":23,"value":1626},"h",{"type":17,"tag":139,"props":1628,"children":1629},{"style":634},[1630],{"type":23,"value":1344},{"type":17,"tag":139,"props":1632,"children":1633},{"style":164},[1634],{"type":23,"value":1635},"  # 创建一个新的分支，指针指向指定的提交\n",{"type":17,"tag":578,"props":1637,"children":1638},{"start":430},[1639],{"type":17,"tag":29,"props":1640,"children":1641},{},[1642],{"type":23,"value":1643},"切换分支",{"type":17,"tag":129,"props":1645,"children":1647},{"code":1646,"language":132,"meta":7,"className":133,"style":7},"git switch \u003Cbranch-name>    # 切换到指定分支\ngit switch -                # 切换到上一个分支，非常方便的在两个分支间来回切换\ngit switch -c \u003Cbranch-name> # 创建并切换分支的快捷方式：\n",[1648],{"type":17,"tag":110,"props":1649,"children":1650},{"__ignoreMap":7},[1651,1684,1705],{"type":17,"tag":139,"props":1652,"children":1653},{"class":141,"line":142},[1654,1658,1663,1667,1671,1675,1679],{"type":17,"tag":139,"props":1655,"children":1656},{"style":146},[1657],{"type":23,"value":149},{"type":17,"tag":139,"props":1659,"children":1660},{"style":152},[1661],{"type":23,"value":1662}," switch",{"type":17,"tag":139,"props":1664,"children":1665},{"style":634},[1666],{"type":23,"value":637},{"type":17,"tag":139,"props":1668,"children":1669},{"style":152},[1670],{"type":23,"value":1572},{"type":17,"tag":139,"props":1672,"children":1673},{"style":204},[1674],{"type":23,"value":1475},{"type":17,"tag":139,"props":1676,"children":1677},{"style":634},[1678],{"type":23,"value":1344},{"type":17,"tag":139,"props":1680,"children":1681},{"style":164},[1682],{"type":23,"value":1683},"    # 切换到指定分支\n",{"type":17,"tag":139,"props":1685,"children":1686},{"class":141,"line":170},[1687,1691,1695,1700],{"type":17,"tag":139,"props":1688,"children":1689},{"style":146},[1690],{"type":23,"value":149},{"type":17,"tag":139,"props":1692,"children":1693},{"style":152},[1694],{"type":23,"value":1662},{"type":17,"tag":139,"props":1696,"children":1697},{"style":152},[1698],{"type":23,"value":1699}," -",{"type":17,"tag":139,"props":1701,"children":1702},{"style":164},[1703],{"type":23,"value":1704},"                # 切换到上一个分支，非常方便的在两个分支间来回切换\n",{"type":17,"tag":139,"props":1706,"children":1707},{"class":141,"line":192},[1708,1712,1716,1721,1725,1729,1733,1737],{"type":17,"tag":139,"props":1709,"children":1710},{"style":146},[1711],{"type":23,"value":149},{"type":17,"tag":139,"props":1713,"children":1714},{"style":152},[1715],{"type":23,"value":1662},{"type":17,"tag":139,"props":1717,"children":1718},{"style":158},[1719],{"type":23,"value":1720}," -c",{"type":17,"tag":139,"props":1722,"children":1723},{"style":634},[1724],{"type":23,"value":637},{"type":17,"tag":139,"props":1726,"children":1727},{"style":152},[1728],{"type":23,"value":1572},{"type":17,"tag":139,"props":1730,"children":1731},{"style":204},[1732],{"type":23,"value":1475},{"type":17,"tag":139,"props":1734,"children":1735},{"style":634},[1736],{"type":23,"value":1344},{"type":17,"tag":139,"props":1738,"children":1739},{"style":164},[1740],{"type":23,"value":1741}," # 创建并切换分支的快捷方式：\n",{"type":17,"tag":578,"props":1743,"children":1744},{"start":456},[1745],{"type":17,"tag":29,"props":1746,"children":1747},{},[1748],{"type":23,"value":1749},"删除分支",{"type":17,"tag":129,"props":1751,"children":1753},{"code":1752,"language":132,"meta":7,"className":133,"style":7},"git branch -d \u003Cbranch-name> # 删除指定分支\ngit branch -D \u003Cbranch-name> # 强制删除指定分支\n",[1754],{"type":17,"tag":110,"props":1755,"children":1756},{"__ignoreMap":7},[1757,1794],{"type":17,"tag":139,"props":1758,"children":1759},{"class":141,"line":142},[1760,1764,1768,1773,1777,1781,1785,1789],{"type":17,"tag":139,"props":1761,"children":1762},{"style":146},[1763],{"type":23,"value":149},{"type":17,"tag":139,"props":1765,"children":1766},{"style":152},[1767],{"type":23,"value":1457},{"type":17,"tag":139,"props":1769,"children":1770},{"style":158},[1771],{"type":23,"value":1772}," -d",{"type":17,"tag":139,"props":1774,"children":1775},{"style":634},[1776],{"type":23,"value":637},{"type":17,"tag":139,"props":1778,"children":1779},{"style":152},[1780],{"type":23,"value":1572},{"type":17,"tag":139,"props":1782,"children":1783},{"style":204},[1784],{"type":23,"value":1475},{"type":17,"tag":139,"props":1786,"children":1787},{"style":634},[1788],{"type":23,"value":1344},{"type":17,"tag":139,"props":1790,"children":1791},{"style":164},[1792],{"type":23,"value":1793}," # 删除指定分支\n",{"type":17,"tag":139,"props":1795,"children":1796},{"class":141,"line":170},[1797,1801,1805,1810,1814,1818,1822,1826],{"type":17,"tag":139,"props":1798,"children":1799},{"style":146},[1800],{"type":23,"value":149},{"type":17,"tag":139,"props":1802,"children":1803},{"style":152},[1804],{"type":23,"value":1457},{"type":17,"tag":139,"props":1806,"children":1807},{"style":158},[1808],{"type":23,"value":1809}," -D",{"type":17,"tag":139,"props":1811,"children":1812},{"style":634},[1813],{"type":23,"value":637},{"type":17,"tag":139,"props":1815,"children":1816},{"style":152},[1817],{"type":23,"value":1572},{"type":17,"tag":139,"props":1819,"children":1820},{"style":204},[1821],{"type":23,"value":1475},{"type":17,"tag":139,"props":1823,"children":1824},{"style":634},[1825],{"type":23,"value":1344},{"type":17,"tag":139,"props":1827,"children":1828},{"style":164},[1829],{"type":23,"value":1830}," # 强制删除指定分支\n",{"type":17,"tag":214,"props":1832,"children":1834},{"id":1833},"分支的基本生命周期",[1835],{"type":23,"value":1833},{"type":17,"tag":254,"props":1837,"children":1838},{},[1839],{"type":17,"tag":66,"props":1840,"children":1841},{},[1842],{"type":23,"value":1843},"永远不能在主分支上直接改动，主分支永远保证功能的完整可用、可部署",{"type":17,"tag":578,"props":1845,"children":1846},{},[1847,1857],{"type":17,"tag":29,"props":1848,"children":1849},{},[1850,1855],{"type":17,"tag":66,"props":1851,"children":1852},{},[1853],{"type":23,"value":1854},"新需求",{"type":23,"value":1856},"：功能\u002Fbug修复\u002F版本回滚\u002F...",{"type":17,"tag":29,"props":1858,"children":1859},{},[1860,1865],{"type":17,"tag":66,"props":1861,"children":1862},{},[1863],{"type":23,"value":1864},"新建分支",{"type":23,"value":754},{"type":17,"tag":129,"props":1867,"children":1869},{"code":1868,"language":132,"meta":7,"className":133,"style":7},"feature\u002F*   - 新功能开发\nbugfix\u002F*    - 缺陷修复\nhotfix\u002F*    - 紧急生产修复\nrelease\u002F*   - 版本发布\nchore\u002F*     - 维护性任务\ndocs\u002F*      - 文档更新\nrefactor\u002F*  - 代码重构\n",[1870],{"type":17,"tag":110,"props":1871,"children":1872},{"__ignoreMap":7},[1873,1891,1909,1926,1943,1961,1980],{"type":17,"tag":139,"props":1874,"children":1875},{"class":141,"line":142},[1876,1881,1886],{"type":17,"tag":139,"props":1877,"children":1878},{"style":146},[1879],{"type":23,"value":1880},"feature\u002F*",{"type":17,"tag":139,"props":1882,"children":1883},{"style":152},[1884],{"type":23,"value":1885},"   -",{"type":17,"tag":139,"props":1887,"children":1888},{"style":152},[1889],{"type":23,"value":1890}," 新功能开发\n",{"type":17,"tag":139,"props":1892,"children":1893},{"class":141,"line":170},[1894,1899,1904],{"type":17,"tag":139,"props":1895,"children":1896},{"style":146},[1897],{"type":23,"value":1898},"bugfix\u002F*",{"type":17,"tag":139,"props":1900,"children":1901},{"style":152},[1902],{"type":23,"value":1903},"    -",{"type":17,"tag":139,"props":1905,"children":1906},{"style":152},[1907],{"type":23,"value":1908}," 缺陷修复\n",{"type":17,"tag":139,"props":1910,"children":1911},{"class":141,"line":192},[1912,1917,1921],{"type":17,"tag":139,"props":1913,"children":1914},{"style":146},[1915],{"type":23,"value":1916},"hotfix\u002F*",{"type":17,"tag":139,"props":1918,"children":1919},{"style":152},[1920],{"type":23,"value":1903},{"type":17,"tag":139,"props":1922,"children":1923},{"style":152},[1924],{"type":23,"value":1925}," 紧急生产修复\n",{"type":17,"tag":139,"props":1927,"children":1928},{"class":141,"line":430},[1929,1934,1938],{"type":17,"tag":139,"props":1930,"children":1931},{"style":146},[1932],{"type":23,"value":1933},"release\u002F*",{"type":17,"tag":139,"props":1935,"children":1936},{"style":152},[1937],{"type":23,"value":1885},{"type":17,"tag":139,"props":1939,"children":1940},{"style":152},[1941],{"type":23,"value":1942}," 版本发布\n",{"type":17,"tag":139,"props":1944,"children":1945},{"class":141,"line":456},[1946,1951,1956],{"type":17,"tag":139,"props":1947,"children":1948},{"style":146},[1949],{"type":23,"value":1950},"chore\u002F*",{"type":17,"tag":139,"props":1952,"children":1953},{"style":152},[1954],{"type":23,"value":1955},"     -",{"type":17,"tag":139,"props":1957,"children":1958},{"style":152},[1959],{"type":23,"value":1960}," 维护性任务\n",{"type":17,"tag":139,"props":1962,"children":1964},{"class":141,"line":1963},6,[1965,1970,1975],{"type":17,"tag":139,"props":1966,"children":1967},{"style":146},[1968],{"type":23,"value":1969},"docs\u002F*",{"type":17,"tag":139,"props":1971,"children":1972},{"style":152},[1973],{"type":23,"value":1974},"      -",{"type":17,"tag":139,"props":1976,"children":1977},{"style":152},[1978],{"type":23,"value":1979}," 文档更新\n",{"type":17,"tag":139,"props":1981,"children":1983},{"class":141,"line":1982},7,[1984,1989,1994],{"type":17,"tag":139,"props":1985,"children":1986},{"style":146},[1987],{"type":23,"value":1988},"refactor\u002F*",{"type":17,"tag":139,"props":1990,"children":1991},{"style":152},[1992],{"type":23,"value":1993},"  -",{"type":17,"tag":139,"props":1995,"children":1996},{"style":152},[1997],{"type":23,"value":1998}," 代码重构\n",{"type":17,"tag":578,"props":2000,"children":2001},{"start":192},[2002,2012,2020,2028],{"type":17,"tag":29,"props":2003,"children":2004},{},[2005,2010],{"type":17,"tag":66,"props":2006,"children":2007},{},[2008],{"type":23,"value":2009},"在分支上开发测试",{"type":23,"value":2011},"：可能产生多次提交",{"type":17,"tag":29,"props":2013,"children":2014},{},[2015],{"type":17,"tag":66,"props":2016,"children":2017},{},[2018],{"type":23,"value":2019},"合并到主分支",{"type":17,"tag":29,"props":2021,"children":2022},{},[2023],{"type":17,"tag":66,"props":2024,"children":2025},{},[2026],{"type":23,"value":2027},"主分支测试",{"type":17,"tag":29,"props":2029,"children":2030},{},[2031],{"type":17,"tag":66,"props":2032,"children":2033},{},[2034],{"type":23,"value":2035},"删除开发分支",{"type":17,"tag":214,"props":2037,"children":2039},{"id":2038},"分支常见问题",[2040],{"type":23,"value":2038},{"type":17,"tag":25,"props":2042,"children":2043},{},[2044],{"type":17,"tag":29,"props":2045,"children":2046},{},[2047],{"type":17,"tag":66,"props":2048,"children":2049},{},[2050],{"type":23,"value":2051},"如何保留现场",{"type":17,"tag":129,"props":2053,"children":2055},{"code":2054},"git stash -a                # 保存当前工作区的修改到存储库\n# 切换分支工作...\n# 切回分支\ngit stash list              # [可选]查询当前存储库\ngit stash pop \u003Cstash-id>    # 调用某个存储库恢复工作区，同时删除存储库\n# 如果存库是最后一个，可以省略 id\n",[2056],{"type":17,"tag":110,"props":2057,"children":2058},{"__ignoreMap":7},[2059],{"type":23,"value":2054},{"type":17,"tag":25,"props":2061,"children":2062},{},[2063],{"type":17,"tag":29,"props":2064,"children":2065},{},[2066,2071],{"type":17,"tag":66,"props":2067,"children":2068},{},[2069],{"type":23,"value":2070},"如何解决冲突",{"type":23,"value":2072},"：冲突必须手动解决，尤其是主分支的冲突",{"type":17,"tag":18,"props":2074,"children":2076},{"id":2075},"远程仓库",[2077],{"type":23,"value":2075},{"type":17,"tag":214,"props":2079,"children":2081},{"id":2080},"注册-github-账号",[2082],{"type":23,"value":2083},"注册 github 账号",{"type":17,"tag":254,"props":2085,"children":2086},{},[2087,2093],{"type":17,"tag":74,"props":2088,"children":2091},{"href":2089,"rel":2090},"https:\u002F\u002Fgithub.com",[78],[2092],{"type":23,"value":2089},{"type":23,"value":2094}," 自行注册",{"type":17,"tag":214,"props":2096,"children":2098},{"id":2097},"ssh-链接通道配置",[2099],{"type":23,"value":2100},"SSH 链接通道配置",{"type":17,"tag":578,"props":2102,"children":2103},{},[2104],{"type":17,"tag":29,"props":2105,"children":2106},{},[2107],{"type":23,"value":2108},"本地生成密钥对",{"type":17,"tag":129,"props":2110,"children":2112},{"code":2111,"language":132,"meta":7,"className":133,"style":7},"ssh-keygen -t ed25519 -C \"注册 github 的邮箱地址\" -f ~\u002F.ssh\u002Fxxx_github_key\n",[2113],{"type":17,"tag":110,"props":2114,"children":2115},{"__ignoreMap":7},[2116],{"type":17,"tag":139,"props":2117,"children":2118},{"class":141,"line":142},[2119,2124,2129,2134,2139,2144,2149],{"type":17,"tag":139,"props":2120,"children":2121},{"style":146},[2122],{"type":23,"value":2123},"ssh-keygen",{"type":17,"tag":139,"props":2125,"children":2126},{"style":158},[2127],{"type":23,"value":2128}," -t",{"type":17,"tag":139,"props":2130,"children":2131},{"style":152},[2132],{"type":23,"value":2133}," ed25519",{"type":17,"tag":139,"props":2135,"children":2136},{"style":158},[2137],{"type":23,"value":2138}," -C",{"type":17,"tag":139,"props":2140,"children":2141},{"style":152},[2142],{"type":23,"value":2143}," \"注册 github 的邮箱地址\"",{"type":17,"tag":139,"props":2145,"children":2146},{"style":158},[2147],{"type":23,"value":2148}," -f",{"type":17,"tag":139,"props":2150,"children":2151},{"style":152},[2152],{"type":23,"value":2153}," ~\u002F.ssh\u002Fxxx_github_key\n",{"type":17,"tag":254,"props":2155,"children":2156},{},[2157,2159,2165],{"type":23,"value":2158},"生成完后，到电脑的 ",{"type":17,"tag":110,"props":2160,"children":2162},{"className":2161},[],[2163],{"type":23,"value":2164},"～\u002F.ssh",{"type":23,"value":2166}," 目录朗可看到之前生成的两个文件：",{"type":17,"tag":129,"props":2168,"children":2170},{"code":2169},"xxx_github_key          # 私钥\nxxx_github_key.pub      # 公钥\n",[2171],{"type":17,"tag":110,"props":2172,"children":2173},{"__ignoreMap":7},[2174],{"type":23,"value":2169},{"type":17,"tag":578,"props":2176,"children":2177},{"start":170},[2178],{"type":17,"tag":29,"props":2179,"children":2180},{},[2181],{"type":23,"value":2182},"到 github 配置公钥",{"type":17,"tag":254,"props":2184,"children":2185},{},[2186,2188,2194],{"type":23,"value":2187},"登录 github 后，在 github 的地址 ",{"type":17,"tag":74,"props":2189,"children":2192},{"href":2190,"rel":2191},"https:\u002F\u002Fgithub.com\u002Fsettings\u002Fkeys",[78],[2193],{"type":23,"value":2190},{"type":23,"value":2195}," 地址下自行配置",{"type":17,"tag":214,"props":2197,"children":2199},{"id":2198},"配置密钥的配对规则",[2200],{"type":23,"value":2198},{"type":17,"tag":129,"props":2202,"children":2204},{"code":2203},"flowchart LR\n    PrivateKey1 \u003C--> PublicKey1ForGithub\n    PrivateKey2 \u003C--> PublicKey2ForGithub\n    PrivateKey1 \u003C--> PublicKey1ForGitee\n    PrivateKey3 \u003C--> PublicKey3ForGitlab\n",[2205],{"type":17,"tag":110,"props":2206,"children":2207},{"__ignoreMap":7},[2208],{"type":23,"value":2203},{"type":17,"tag":578,"props":2210,"children":2211},{},[2212,2225],{"type":17,"tag":29,"props":2213,"children":2214},{},[2215,2217,2223],{"type":23,"value":2216},"打开 ",{"type":17,"tag":110,"props":2218,"children":2220},{"className":2219},[],[2221],{"type":23,"value":2222},"~\u002F.ssh\u002Fconfig",{"type":23,"value":2224},"，没有就创建一个",{"type":17,"tag":29,"props":2226,"children":2227},{},[2228],{"type":23,"value":2229},"配置规则",{"type":17,"tag":129,"props":2231,"children":2233},{"code":2232},"# 规则 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",[2234],{"type":17,"tag":110,"props":2235,"children":2236},{"__ignoreMap":7},[2237],{"type":23,"value":2232},{"type":17,"tag":214,"props":2239,"children":2241},{"id":2240},"仓库和别名",[2242],{"type":23,"value":2240},{"type":17,"tag":254,"props":2244,"children":2245},{},[2246],{"type":23,"value":2247},"要和远程仓库同步，先得有远程仓库",{"type":17,"tag":578,"props":2249,"children":2250},{},[2251,2256],{"type":17,"tag":29,"props":2252,"children":2253},{},[2254],{"type":23,"value":2255},"在 github 中创建一个远程仓库",{"type":17,"tag":29,"props":2257,"children":2258},{},[2259],{"type":23,"value":2260},"在本地仓库中添加远程仓库的别名",{"type":17,"tag":254,"props":2262,"children":2263},{},[2264],{"type":23,"value":2265},"别名的常见操作",{"type":17,"tag":129,"props":2267,"children":2269},{"code":2268,"language":132,"meta":7,"className":133,"style":7},"# 查看当前的远程仓库的别名\ngit remote          # 简要信息\ngit remote -v       # 详细信息\n\n# 添加别名\ngit remote add 远程仓库别名 远程仓库ssh地址\n\n# 修改别名\ngit remote rename 原别名 新别名\n\n# 删除别名\ngit remote remove 要删除的别名\n",[2270],{"type":17,"tag":110,"props":2271,"children":2272},{"__ignoreMap":7},[2273,2281,2298,2319,2328,2336,2361,2368,2377,2404,2412,2421],{"type":17,"tag":139,"props":2274,"children":2275},{"class":141,"line":142},[2276],{"type":17,"tag":139,"props":2277,"children":2278},{"style":164},[2279],{"type":23,"value":2280},"# 查看当前的远程仓库的别名\n",{"type":17,"tag":139,"props":2282,"children":2283},{"class":141,"line":170},[2284,2288,2293],{"type":17,"tag":139,"props":2285,"children":2286},{"style":146},[2287],{"type":23,"value":149},{"type":17,"tag":139,"props":2289,"children":2290},{"style":152},[2291],{"type":23,"value":2292}," remote",{"type":17,"tag":139,"props":2294,"children":2295},{"style":164},[2296],{"type":23,"value":2297},"          # 简要信息\n",{"type":17,"tag":139,"props":2299,"children":2300},{"class":141,"line":192},[2301,2305,2309,2314],{"type":17,"tag":139,"props":2302,"children":2303},{"style":146},[2304],{"type":23,"value":149},{"type":17,"tag":139,"props":2306,"children":2307},{"style":152},[2308],{"type":23,"value":2292},{"type":17,"tag":139,"props":2310,"children":2311},{"style":158},[2312],{"type":23,"value":2313}," -v",{"type":17,"tag":139,"props":2315,"children":2316},{"style":164},[2317],{"type":23,"value":2318},"       # 详细信息\n",{"type":17,"tag":139,"props":2320,"children":2321},{"class":141,"line":430},[2322],{"type":17,"tag":139,"props":2323,"children":2325},{"emptyLinePlaceholder":2324},true,[2326],{"type":23,"value":2327},"\n",{"type":17,"tag":139,"props":2329,"children":2330},{"class":141,"line":456},[2331],{"type":17,"tag":139,"props":2332,"children":2333},{"style":164},[2334],{"type":23,"value":2335},"# 添加别名\n",{"type":17,"tag":139,"props":2337,"children":2338},{"class":141,"line":1963},[2339,2343,2347,2351,2356],{"type":17,"tag":139,"props":2340,"children":2341},{"style":146},[2342],{"type":23,"value":149},{"type":17,"tag":139,"props":2344,"children":2345},{"style":152},[2346],{"type":23,"value":2292},{"type":17,"tag":139,"props":2348,"children":2349},{"style":152},[2350],{"type":23,"value":631},{"type":17,"tag":139,"props":2352,"children":2353},{"style":152},[2354],{"type":23,"value":2355}," 远程仓库别名",{"type":17,"tag":139,"props":2357,"children":2358},{"style":152},[2359],{"type":23,"value":2360}," 远程仓库ssh地址\n",{"type":17,"tag":139,"props":2362,"children":2363},{"class":141,"line":1982},[2364],{"type":17,"tag":139,"props":2365,"children":2366},{"emptyLinePlaceholder":2324},[2367],{"type":23,"value":2327},{"type":17,"tag":139,"props":2369,"children":2371},{"class":141,"line":2370},8,[2372],{"type":17,"tag":139,"props":2373,"children":2374},{"style":164},[2375],{"type":23,"value":2376},"# 修改别名\n",{"type":17,"tag":139,"props":2378,"children":2380},{"class":141,"line":2379},9,[2381,2385,2389,2394,2399],{"type":17,"tag":139,"props":2382,"children":2383},{"style":146},[2384],{"type":23,"value":149},{"type":17,"tag":139,"props":2386,"children":2387},{"style":152},[2388],{"type":23,"value":2292},{"type":17,"tag":139,"props":2390,"children":2391},{"style":152},[2392],{"type":23,"value":2393}," rename",{"type":17,"tag":139,"props":2395,"children":2396},{"style":152},[2397],{"type":23,"value":2398}," 原别名",{"type":17,"tag":139,"props":2400,"children":2401},{"style":152},[2402],{"type":23,"value":2403}," 新别名\n",{"type":17,"tag":139,"props":2405,"children":2407},{"class":141,"line":2406},10,[2408],{"type":17,"tag":139,"props":2409,"children":2410},{"emptyLinePlaceholder":2324},[2411],{"type":23,"value":2327},{"type":17,"tag":139,"props":2413,"children":2415},{"class":141,"line":2414},11,[2416],{"type":17,"tag":139,"props":2417,"children":2418},{"style":164},[2419],{"type":23,"value":2420},"# 删除别名\n",{"type":17,"tag":139,"props":2422,"children":2424},{"class":141,"line":2423},12,[2425,2429,2433,2438],{"type":17,"tag":139,"props":2426,"children":2427},{"style":146},[2428],{"type":23,"value":149},{"type":17,"tag":139,"props":2430,"children":2431},{"style":152},[2432],{"type":23,"value":2292},{"type":17,"tag":139,"props":2434,"children":2435},{"style":152},[2436],{"type":23,"value":2437}," remove",{"type":17,"tag":139,"props":2439,"children":2440},{"style":152},[2441],{"type":23,"value":2442}," 要删除的别名\n",{"type":17,"tag":214,"props":2444,"children":2446},{"id":2445},"远程仓库与本地仓库之间的分支同步",[2447],{"type":23,"value":2445},{"type":17,"tag":254,"props":2449,"children":2450},{},[2451,2456],{"type":17,"tag":66,"props":2452,"children":2453},{},[2454],{"type":23,"value":2455},"push 命令",{"type":23,"value":754},{"type":17,"tag":129,"props":2458,"children":2460},{"code":2459},"  本地仓库                  远程仓库\n   \n   master --- git push ---> master\n                              |\n",[2461],{"type":17,"tag":110,"props":2462,"children":2463},{"__ignoreMap":7},[2464],{"type":23,"value":2459},{"type":17,"tag":254,"props":2466,"children":2467},{},[2468],{"type":23,"value":2469},"origin\u002Fmaster \u003C-- 自动同步 --------|",{"type":17,"tag":129,"props":2471,"children":2473},{"code":2472,"language":132,"meta":7,"className":133,"style":7},"# 将本地的某个分支推送到指定仓库\ngit push -u 远程仓库别名 本地分支名\n",[2474],{"type":17,"tag":110,"props":2475,"children":2476},{"__ignoreMap":7},[2477,2485],{"type":17,"tag":139,"props":2478,"children":2479},{"class":141,"line":142},[2480],{"type":17,"tag":139,"props":2481,"children":2482},{"style":164},[2483],{"type":23,"value":2484},"# 将本地的某个分支推送到指定仓库\n",{"type":17,"tag":139,"props":2486,"children":2487},{"class":141,"line":170},[2488,2492,2496,2500,2504],{"type":17,"tag":139,"props":2489,"children":2490},{"style":146},[2491],{"type":23,"value":149},{"type":17,"tag":139,"props":2493,"children":2494},{"style":152},[2495],{"type":23,"value":1238},{"type":17,"tag":139,"props":2497,"children":2498},{"style":158},[2499],{"type":23,"value":1243},{"type":17,"tag":139,"props":2501,"children":2502},{"style":152},[2503],{"type":23,"value":2355},{"type":17,"tag":139,"props":2505,"children":2506},{"style":152},[2507],{"type":23,"value":2508}," 本地分支名\n",{"type":17,"tag":254,"props":2510,"children":2511},{},[2512],{"type":23,"value":2513},"细节说明：",{"type":17,"tag":25,"props":2515,"children":2516},{},[2517,2522,2558],{"type":17,"tag":29,"props":2518,"children":2519},{},[2520],{"type":23,"value":2521},"如果远程没有相关分支，则在远程创建同名分支",{"type":17,"tag":29,"props":2523,"children":2524},{},[2525,2527],{"type":23,"value":2526},"推送完成后，会在本地创建远程跟踪分支\n",{"type":17,"tag":25,"props":2528,"children":2529},{},[2530,2548,2553],{"type":17,"tag":29,"props":2531,"children":2532},{},[2533,2535,2540,2542],{"type":23,"value":2534},"跟踪分支自动命名：",{"type":17,"tag":66,"props":2536,"children":2537},{},[2538],{"type":23,"value":2539},"仓库别名\u002F分支名",{"type":23,"value":2541},"，如 ",{"type":17,"tag":110,"props":2543,"children":2545},{"className":2544},[],[2546],{"type":23,"value":2547},"origin\u002Fmaster",{"type":17,"tag":29,"props":2549,"children":2550},{},[2551],{"type":23,"value":2552},"跟踪分支是只读的，它的目的在于同步远程分支",{"type":17,"tag":29,"props":2554,"children":2555},{},[2556],{"type":23,"value":2557},"推送完成后，会自动同步远程跟踪分支",{"type":17,"tag":29,"props":2559,"children":2560},{},[2561,2563,2569,2571,2577,2579,2585],{"type":23,"value":2562},"由于使用了参数 ",{"type":17,"tag":110,"props":2564,"children":2566},{"className":2565},[],[2567],{"type":23,"value":2568},"-u",{"type":23,"value":2570}," 在跟踪分支创建后，会自动把本地分支 ",{"type":17,"tag":110,"props":2572,"children":2574},{"className":2573},[],[2575],{"type":23,"value":2576},"master",{"type":23,"value":2578}," 绑定到跟踪分支 ",{"type":17,"tag":110,"props":2580,"children":2582},{"className":2581},[],[2583],{"type":23,"value":2584},"origin\u002Fmain",{"type":17,"tag":25,"props":2586,"children":2587},{},[2588],{"type":17,"tag":29,"props":2589,"children":2590},{},[2591,2593,2599],{"type":23,"value":2592},"后续仅需要使用 ",{"type":17,"tag":110,"props":2594,"children":2596},{"className":2595},[],[2597],{"type":23,"value":2598},"git push",{"type":23,"value":2600}," 即可推送当前的 master 分支",{"type":17,"tag":254,"props":2602,"children":2603},{},[2604],{"type":23,"value":2605},"这样，就完成了本地到远程的同步",{"type":17,"tag":254,"props":2607,"children":2608},{},[2609,2614],{"type":17,"tag":66,"props":2610,"children":2611},{},[2612],{"type":23,"value":2613},"pull 命令",{"type":23,"value":754},{"type":17,"tag":129,"props":2616,"children":2618},{"code":2617},"  本地仓库                         远程仓库\n   \n   master\n     ∧\n     | git merge\n     |                      \n",[2619],{"type":17,"tag":110,"props":2620,"children":2621},{"__ignoreMap":7},[2622],{"type":23,"value":2617},{"type":17,"tag":254,"props":2624,"children":2625},{},[2626],{"type":23,"value":2627},"origin\u002Fmaster \u003C------ git fetch ------ master",{"type":17,"tag":578,"props":2629,"children":2630},{},[2631],{"type":17,"tag":29,"props":2632,"children":2633},{},[2634,2635,2641],{"type":23,"value":494},{"type":17,"tag":110,"props":2636,"children":2638},{"className":2637},[],[2639],{"type":23,"value":2640},"git fetch",{"type":23,"value":2642}," 命令",{"type":17,"tag":129,"props":2644,"children":2646},{"code":2645,"language":132,"meta":7,"className":133,"style":7},"git fetch 远程仓库别名 远程分支名\n",[2647],{"type":17,"tag":110,"props":2648,"children":2649},{"__ignoreMap":7},[2650],{"type":17,"tag":139,"props":2651,"children":2652},{"class":141,"line":142},[2653,2657,2662,2666],{"type":17,"tag":139,"props":2654,"children":2655},{"style":146},[2656],{"type":23,"value":149},{"type":17,"tag":139,"props":2658,"children":2659},{"style":152},[2660],{"type":23,"value":2661}," fetch",{"type":17,"tag":139,"props":2663,"children":2664},{"style":152},[2665],{"type":23,"value":2355},{"type":17,"tag":139,"props":2667,"children":2668},{"style":152},[2669],{"type":23,"value":2670}," 远程分支名\n",{"type":17,"tag":578,"props":2672,"children":2673},{"start":170},[2674],{"type":17,"tag":29,"props":2675,"children":2676},{},[2677],{"type":23,"value":2678},"使用 git merge 命令合并分支",{"type":17,"tag":129,"props":2680,"children":2682},{"code":2681,"language":132,"meta":7,"className":133,"style":7},"# 确保当前在对应的分支上\ngit merge 本地跟踪分支名\n",[2683],{"type":17,"tag":110,"props":2684,"children":2685},{"__ignoreMap":7},[2686,2694],{"type":17,"tag":139,"props":2687,"children":2688},{"class":141,"line":142},[2689],{"type":17,"tag":139,"props":2690,"children":2691},{"style":164},[2692],{"type":23,"value":2693},"# 确保当前在对应的分支上\n",{"type":17,"tag":139,"props":2695,"children":2696},{"class":141,"line":170},[2697,2701,2706],{"type":17,"tag":139,"props":2698,"children":2699},{"style":146},[2700],{"type":23,"value":149},{"type":17,"tag":139,"props":2702,"children":2703},{"style":152},[2704],{"type":23,"value":2705}," merge",{"type":17,"tag":139,"props":2707,"children":2708},{"style":152},[2709],{"type":23,"value":2710}," 本地跟踪分支名\n",{"type":17,"tag":254,"props":2712,"children":2713},{},[2714],{"type":23,"value":2715},"这样，就完成了远程到本地的同步",{"type":17,"tag":254,"props":2717,"children":2718},{},[2719],{"type":23,"value":2720},"使用 git pull 命令，可以一步替代上面的两步操作",{"type":17,"tag":129,"props":2722,"children":2724},{"code":2723,"language":132,"meta":7,"className":133,"style":7},"git pull 远程仓库 远程分支\n",[2725],{"type":17,"tag":110,"props":2726,"children":2727},{"__ignoreMap":7},[2728],{"type":17,"tag":139,"props":2729,"children":2730},{"class":141,"line":142},[2731,2735,2740,2745],{"type":17,"tag":139,"props":2732,"children":2733},{"style":146},[2734],{"type":23,"value":149},{"type":17,"tag":139,"props":2736,"children":2737},{"style":152},[2738],{"type":23,"value":2739}," pull",{"type":17,"tag":139,"props":2741,"children":2742},{"style":152},[2743],{"type":23,"value":2744}," 远程仓库",{"type":17,"tag":139,"props":2746,"children":2747},{"style":152},[2748],{"type":23,"value":2749}," 远程分支\n",{"type":17,"tag":254,"props":2751,"children":2752},{},[2753,2758],{"type":17,"tag":66,"props":2754,"children":2755},{},[2756],{"type":23,"value":2757},"clone 命令",{"type":23,"value":754},{"type":17,"tag":254,"props":2760,"children":2761},{},[2762,2764,2770],{"type":23,"value":2763},"当本地没有工程时，可以使用 ",{"type":17,"tag":110,"props":2765,"children":2767},{"className":2766},[],[2768],{"type":23,"value":2769},"git clone",{"type":23,"value":2771}," 操作快速完成远程仓库的下载",{"type":17,"tag":129,"props":2773,"children":2775},{"code":2774,"language":132,"meta":7,"className":133,"style":7},"git clone [-b 分支名] 远程仓库地址 [本地想要保存的文件夹]\n",[2776],{"type":17,"tag":110,"props":2777,"children":2778},{"__ignoreMap":7},[2779],{"type":17,"tag":139,"props":2780,"children":2781},{"class":141,"line":142},[2782,2786,2791,2796,2801,2806],{"type":17,"tag":139,"props":2783,"children":2784},{"style":146},[2785],{"type":23,"value":149},{"type":17,"tag":139,"props":2787,"children":2788},{"style":152},[2789],{"type":23,"value":2790}," clone",{"type":17,"tag":139,"props":2792,"children":2793},{"style":204},[2794],{"type":23,"value":2795}," [-b ",{"type":17,"tag":139,"props":2797,"children":2798},{"style":152},[2799],{"type":23,"value":2800},"分支名]",{"type":17,"tag":139,"props":2802,"children":2803},{"style":152},[2804],{"type":23,"value":2805}," 远程仓库地址",{"type":17,"tag":139,"props":2807,"children":2808},{"style":204},[2809],{"type":23,"value":2810}," [本地想要保存的文件夹]\n",{"type":17,"tag":214,"props":2812,"children":2814},{"id":2813},"同步的三种情况",[2815],{"type":23,"value":2813},{"type":17,"tag":578,"props":2817,"children":2818},{},[2819,2824,2829],{"type":17,"tag":29,"props":2820,"children":2821},{},[2822],{"type":23,"value":2823},"情况一：远程快进",{"type":17,"tag":29,"props":2825,"children":2826},{},[2827],{"type":23,"value":2828},"情况二：本地快进",{"type":17,"tag":29,"props":2830,"children":2831},{},[2832,2834],{"type":23,"value":2833},"情况三：出现冲突\n",{"type":17,"tag":578,"props":2835,"children":2836},{},[2837,2848,2861,2866,2877],{"type":17,"tag":29,"props":2838,"children":2839},{},[2840,2842],{"type":23,"value":2841},"获取远程代码：",{"type":17,"tag":110,"props":2843,"children":2845},{"className":2844},[],[2846],{"type":23,"value":2847},"git fetch orgin master",{"type":17,"tag":29,"props":2849,"children":2850},{},[2851,2853,2859],{"type":23,"value":2852},"本地进行合并，",{"type":17,"tag":110,"props":2854,"children":2856},{"className":2855},[],[2857],{"type":23,"value":2858},"git merge origin\u002Fmaster",{"type":23,"value":2860},"，报错冲突",{"type":17,"tag":29,"props":2862,"children":2863},{},[2864],{"type":23,"value":2865},"手动解决冲突",{"type":17,"tag":29,"props":2867,"children":2868},{},[2869,2871],{"type":23,"value":2870},"本地提交一次，",{"type":17,"tag":110,"props":2872,"children":2874},{"className":2873},[],[2875],{"type":23,"value":2876},"git commit -m \"xxxxx\"",{"type":17,"tag":29,"props":2878,"children":2879},{},[2880,2882],{"type":23,"value":2881},"本地推送到远程，",{"type":17,"tag":110,"props":2883,"children":2885},{"className":2884},[],[2886],{"type":23,"value":2887},"git push origin master",{"type":17,"tag":214,"props":2889,"children":2891},{"id":2890},"简单总结",[2892],{"type":23,"value":2890},{"type":17,"tag":578,"props":2894,"children":2895},{},[2896,2901,2906],{"type":17,"tag":29,"props":2897,"children":2898},{},[2899],{"type":23,"value":2900},"正常推送拉取，没问题什么也不管",{"type":17,"tag":29,"props":2902,"children":2903},{},[2904],{"type":23,"value":2905},"推送报错，进入第 3 步",{"type":17,"tag":29,"props":2907,"children":2908},{},[2909],{"type":23,"value":2910},"拉取有冲突，解决冲突重新提交，然后进入第 2 步",{"type":17,"tag":18,"props":2912,"children":2914},{"id":2913},"github-flow",[2915],{"type":23,"value":2916},"github flow",{"type":17,"tag":214,"props":2918,"children":2920},{"id":2919},"完整流程",[2921],{"type":23,"value":2919},{"type":17,"tag":129,"props":2923,"children":2925},{"code":2924},"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",[2926],{"type":17,"tag":110,"props":2927,"children":2928},{"__ignoreMap":7},[2929],{"type":23,"value":2924},{"type":17,"tag":214,"props":2931,"children":2933},{"id":2932},"开发者规范",[2934],{"type":23,"value":2932},{"type":17,"tag":578,"props":2936,"children":2937},{},[2938,2943],{"type":17,"tag":29,"props":2939,"children":2940},{},[2941],{"type":23,"value":2942},"master 分支只读",{"type":17,"tag":29,"props":2944,"children":2945},{},[2946],{"type":23,"value":2947},"基于最新的提交进行开发",{"type":17,"tag":214,"props":2949,"children":2951},{"id":2950},"管理员规范",[2952],{"type":23,"value":2950},{"type":17,"tag":578,"props":2954,"children":2955},{},[2956,2961],{"type":17,"tag":29,"props":2957,"children":2958},{},[2959],{"type":23,"value":2960},"master 分支只能通过 PR 来修改",{"type":17,"tag":29,"props":2962,"children":2963},{},[2964],{"type":23,"value":2965},"PR 永远无冲突",{"type":17,"tag":918,"props":2967,"children":2968},{},[2969],{"type":23,"value":2970},"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":7,"searchDepth":170,"depth":170,"links":2972},[2973,2974,2975,2976,2977,2978,2979,2980,2981,2982],{"id":20,"depth":170,"text":20},{"id":56,"depth":170,"text":56},{"id":120,"depth":170,"text":120},{"id":125,"depth":170,"text":125},{"id":482,"depth":170,"text":482},{"id":518,"depth":170,"text":521},{"id":537,"depth":170,"text":537},{"id":1352,"depth":170,"text":1352},{"id":2075,"depth":170,"text":2075},{"id":2913,"depth":170,"text":2916},"markdown","content:it:002.md","content","it\u002F002.md","it\u002F002","md",1781529092109]