[{"data":1,"prerenderedAt":2636},["ShallowReactive",2],{"wiki-page-\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao":3,"wiki-doc-items-\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao":2600,"language-switcher-data-\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao":2620,"wiki-i18n-paths-\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao":2635},{"id":4,"title":5,"body":6,"canonicalPath":2580,"chapterDepth":2581,"chapterOrder":2582,"date":2583,"description":30,"docI18nKey":2584,"docKey":2585,"docRoot":2586,"docTitle":2587,"extension":2588,"i18nKey":2589,"isBlogPost":2590,"isWikiDoc":2591,"isWikiIndex":2590,"layout":2592,"legacyPath":2592,"locale":2593,"localeSlug":2594,"meta":2595,"navigation":2591,"path":2580,"seo":2596,"sourcePath":2597,"sourceStem":2589,"stem":2598,"wikiDepth":38,"__hash__":2599},"content\u002F_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002F0200-Git实操.md","Git in Practice",{"type":7,"value":8,"toc":2575},"minimark",[9,14,24,73,80,84,89,112,117,121,156,160,172,177,181,199,204,208,240,245,248,253,256,261,268,273,277,289,294,297,300,304,318,323,327,355,360,364,376,381,390,394,431,436,441,445,464,495,500,505,513,530,535,540,544,552,572,577,596,601,613,618,621,627,658,663,669,693,698,704,722,727,745,751,772,777,783,800,805,809,814,842,847,852,857,876,881,886,911,916,921,925,930,952,957,962,967,997,1002,1007,1012,1025,1030,1033,1037,1051,1056,1061,1066,1071,1074,1079,1082,1087,1092,1097,1100,1105,1110,1115,1120,1153,1158,1161,1169,1174,1193,1198,1203,1208,1213,1228,1233,1238,1250,1255,1258,1266,1271,1276,1279,1282,1287,1290,1295,1300,1305,1308,1314,1319,1325,1337,1342,1348,1368,1373,1379,1391,1396,1402,1412,1417,1421,1424,1429,1466,1472,1477,1488,1495,1498,1506,1511,1522,1546,1551,1570,1580,1585,1590,1604,1609,1612,1621,1629,1635,1640,1645,1652,1657,1662,1665,1675,1680,1682,1688,1693,1699,1729,1732,1737,1743,1748,1753,1764,1769,1774,1779,1785,1790,1795,1829,1834,1838,1845,1848,1891,1902,1954,1957,1969,1981,1987,1991,1995,1998,2002,2008,2012,2017,2021,2026,2031,2039,2044,2049,2052,2060,2065,2069,2074,2077,2081,2086,2089,2093,2098,2103,2107,2112,2115,2119,2124,2128,2133,2137,2142,2147,2150,2155,2160,2165,2169,2182,2187,2192,2197,2202,2207,2212,2217,2221,2224,2230,2235,2245,2250,2255,2262,2267,2272,2282,2286,2291,2296,2301,2306,2311,2314,2319,2328,2336,2344,2349,2354,2357,2362,2367,2381,2386,2391,2394,2402,2410,2417,2425,2433,2444,2449,2456,2461,2466,2469,2472,2477,2482,2485,2490,2496,2501,2504,2509,2512,2517,2520,2525,2530,2537,2542,2547,2553,2558,2563,2566,2571],[10,11,13],"h3",{"id":12},"environment-setup","Environment Setup",[15,16,17,21],"ol",{},[18,19,20],"li",{},"Operating System: Linux, Windows, MacOS (This tutorial uses Linux as the example)",[18,22,23],{},"Install Git",[25,26,31],"pre",{"className":27,"code":28,"language":29,"meta":30,"style":30},"language-bash shiki shiki-themes github-light github-dark","sudo apt-get update\nsudo apt-get install git\ngit --version\n","bash","",[32,33,34,50,63],"code",{"__ignoreMap":30},[35,36,39,43,47],"span",{"class":37,"line":38},"line",1,[35,40,42],{"class":41},"sScJk","sudo",[35,44,46],{"class":45},"sZZnC"," apt-get",[35,48,49],{"class":45}," update\n",[35,51,53,55,57,60],{"class":37,"line":52},2,[35,54,42],{"class":41},[35,56,46],{"class":45},[35,58,59],{"class":45}," install",[35,61,62],{"class":45}," git\n",[35,64,66,69],{"class":37,"line":65},3,[35,67,68],{"class":41},"git",[35,70,72],{"class":71},"sj4cs"," --version\n",[74,75,76],"p",{},[77,78],"img",{"alt":30,"src":79},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage2.webp",[10,81,83],{"id":82},"introduction-to-common-commands","Introduction to Common Commands",[85,86,88],"h4",{"id":87},"linux-creates-a-directory-and-enters-it","Linux creates a directory && and enters it",[25,90,92],{"className":27,"code":91,"language":29,"meta":30,"style":30},"mkdir -p hellogit\ncd hellogit\n",[32,93,94,105],{"__ignoreMap":30},[35,95,96,99,102],{"class":37,"line":38},[35,97,98],{"class":41},"mkdir",[35,100,101],{"class":71}," -p",[35,103,104],{"class":45}," hellogit\n",[35,106,107,110],{"class":37,"line":52},[35,108,109],{"class":71},"cd",[35,111,104],{"class":45},[74,113,114],{},[77,115],{"alt":30,"src":116},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage3.webp",[85,118,120],{"id":119},"set-up-git-username-and-email-must-be-set","Set up Git username and email (MUST be set!!!)",[25,122,124],{"className":27,"code":123,"language":29,"meta":30,"style":30},"git config --global user.name \"tungchiahui\"\ngit config --global user.email tungchiahui@gmail.com\n",[32,125,126,142],{"__ignoreMap":30},[35,127,128,130,133,136,139],{"class":37,"line":38},[35,129,68],{"class":41},[35,131,132],{"class":45}," config",[35,134,135],{"class":71}," --global",[35,137,138],{"class":45}," user.name",[35,140,141],{"class":45}," \"tungchiahui\"\n",[35,143,144,146,148,150,153],{"class":37,"line":52},[35,145,68],{"class":41},[35,147,132],{"class":45},[35,149,135],{"class":71},[35,151,152],{"class":45}," user.email",[35,154,155],{"class":45}," tungchiahui@gmail.com\n",[85,157,159],{"id":158},"git-initialization-making-this-folder-controlled-by-git","Git initialization (making this folder controlled by Git)",[25,161,163],{"className":27,"code":162,"language":29,"meta":30,"style":30},"git init\n",[32,164,165],{"__ignoreMap":30},[35,166,167,169],{"class":37,"line":38},[35,168,68],{"class":41},[35,170,171],{"class":45}," init\n",[74,173,174],{},[77,175],{"alt":30,"src":176},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage4.webp",[85,178,180],{"id":179},"create-a-file-view-all-files-in-the-current-folder","Create a file && view all files in the current folder",[25,182,184],{"className":27,"code":183,"language":29,"meta":30,"style":30},"touch test.md\nls\n",[32,185,186,194],{"__ignoreMap":30},[35,187,188,191],{"class":37,"line":38},[35,189,190],{"class":41},"touch",[35,192,193],{"class":45}," test.md\n",[35,195,196],{"class":37,"line":52},[35,197,198],{"class":41},"ls\n",[74,200,201],{},[77,202],{"alt":30,"src":203},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage5.webp",[85,205,207],{"id":206},"edit-the-files-text-content","Edit the file's text content.",[25,209,211],{"className":27,"code":210,"language":29,"meta":30,"style":30},"sudo apt-get update\nsudo apt-get install vim\nvim .\u002Ftest.md\n",[32,212,213,221,232],{"__ignoreMap":30},[35,214,215,217,219],{"class":37,"line":38},[35,216,42],{"class":41},[35,218,46],{"class":45},[35,220,49],{"class":45},[35,222,223,225,227,229],{"class":37,"line":52},[35,224,42],{"class":41},[35,226,46],{"class":45},[35,228,59],{"class":45},[35,230,231],{"class":45}," vim\n",[35,233,234,237],{"class":37,"line":65},[35,235,236],{"class":41},"vim",[35,238,239],{"class":45}," .\u002Ftest.md\n",[74,241,242],{},[77,243],{"alt":30,"src":244},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage6.webp",[74,246,247],{},"Next, press the Insert key on the keyboard to enter edit mode and type a piece of text.",[74,249,250],{},[77,251],{"alt":30,"src":252},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage7.webp",[74,254,255],{},"Press ESC to exit edit mode.",[74,257,258],{},[77,259],{"alt":30,"src":260},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage8.webp",[74,262,263,264,267],{},"Press Shift + colon, then type ",[32,265,266],{},"wq"," and press Enter to save and exit.",[74,269,270],{},[77,271],{"alt":30,"src":272},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage9.webp",[85,274,276],{"id":275},"query-the-current-files-status","Query the current file's status.",[25,278,280],{"className":27,"code":279,"language":29,"meta":30,"style":30},"git status\n",[32,281,282],{"__ignoreMap":30},[35,283,284,286],{"class":37,"line":38},[35,285,68],{"class":41},[35,287,288],{"class":45}," status\n",[74,290,291],{},[77,292],{"alt":30,"src":293},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage10.webp",[74,295,296],{},"On branch branch name",[74,298,299],{},"Untracked means the file is in the working directory.",[85,301,303],{"id":302},"stage-the-file-to-the-staging-area","Stage the file to the staging area",[25,305,307],{"className":27,"code":306,"language":29,"meta":30,"style":30},"git add test.md\n",[32,308,309],{"__ignoreMap":30},[35,310,311,313,316],{"class":37,"line":38},[35,312,68],{"class":41},[35,314,315],{"class":45}," add",[35,317,193],{"class":45},[74,319,320],{},[77,321],{"alt":30,"src":322},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage11.webp",[85,324,326],{"id":325},"commit-the-file-to-the-local-repository","Commit the file to the local repository.",[25,328,330],{"className":27,"code":329,"language":29,"meta":30,"style":30},"git commit -m \"version1\"  \n#git commit -m \"提交的信息(可以理解为是注释)\"\n",[32,331,332,349],{"__ignoreMap":30},[35,333,334,336,339,342,345],{"class":37,"line":38},[35,335,68],{"class":41},[35,337,338],{"class":45}," commit",[35,340,341],{"class":71}," -m",[35,343,344],{"class":45}," \"version1\"",[35,346,348],{"class":347},"sVt8B","  \n",[35,350,351],{"class":37,"line":52},[35,352,354],{"class":353},"sJ8bj","#git commit -m \"提交的信息(可以理解为是注释)\"\n",[74,356,357],{},[77,358],{"alt":30,"src":359},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage12.webp",[85,361,363],{"id":362},"view-the-submitted-project-version","View the submitted project version.",[25,365,367],{"className":27,"code":366,"language":29,"meta":30,"style":30},"git log\n",[32,368,369],{"__ignoreMap":30},[35,370,371,373],{"class":37,"line":38},[35,372,68],{"class":41},[35,374,375],{"class":45}," log\n",[74,377,378],{},[77,379],{"alt":30,"src":380},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage13.webp",[74,382,383,384,389],{},"These lines mean that user tungchiahui (email: ",[385,386,388],"a",{"href":387},"mailto:tungchiahui@gmail.com","tungchiahui@gmail.com",") committed a project version annotated as \"version1\" to the master branch on Saturday, December 30, 2023 at 00:42:47.",[85,391,393],{"id":392},"you-can-try-modifying-the-file-content-and-then-commit-again","You can try modifying the file content and then commit again.",[25,395,397],{"className":27,"code":396,"language":29,"meta":30,"style":30},"vim test.md\ngit add test.md\ngit commit -m \"version2\"\ngit log\n",[32,398,399,405,413,424],{"__ignoreMap":30},[35,400,401,403],{"class":37,"line":38},[35,402,236],{"class":41},[35,404,193],{"class":45},[35,406,407,409,411],{"class":37,"line":52},[35,408,68],{"class":41},[35,410,315],{"class":45},[35,412,193],{"class":45},[35,414,415,417,419,421],{"class":37,"line":65},[35,416,68],{"class":41},[35,418,338],{"class":45},[35,420,341],{"class":71},[35,422,423],{"class":45}," \"version2\"\n",[35,425,427,429],{"class":37,"line":426},4,[35,428,68],{"class":41},[35,430,375],{"class":45},[74,432,433],{},[77,434],{"alt":30,"src":435},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage14.webp",[74,437,438],{},[77,439],{"alt":30,"src":440},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage15.webp",[85,442,444],{"id":443},"how-to-ignore-files-you-dont-want-to-commit","How to ignore files you don't want to commit",[15,446,447,454,461],{},[18,448,449,450,453],{},"First, create a file ",[32,451,452],{},".gitignore",".",[18,455,456,457,460],{},"Create another file ",[32,458,459],{},"top_secret_file_not_to_be_open_sourced.py"," and modify its contents.",[18,462,463],{},"Check the git status.",[25,465,467],{"className":27,"code":466,"language":29,"meta":30,"style":30},"touch .gitignore\ntouch vinci_secret.py\nvim vinci_secret.py\ngit status\n",[32,468,469,476,483,489],{"__ignoreMap":30},[35,470,471,473],{"class":37,"line":38},[35,472,190],{"class":41},[35,474,475],{"class":45}," .gitignore\n",[35,477,478,480],{"class":37,"line":52},[35,479,190],{"class":41},[35,481,482],{"class":45}," vinci_secret.py\n",[35,484,485,487],{"class":37,"line":65},[35,486,236],{"class":41},[35,488,482],{"class":45},[35,490,491,493],{"class":37,"line":426},[35,492,68],{"class":41},[35,494,288],{"class":45},[74,496,497],{},[77,498],{"alt":30,"src":499},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage16.webp",[74,501,502],{},[77,503],{"alt":30,"src":504},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage17.webp",[15,506,507],{"start":426},[18,508,509,510,512],{},"Modify the contents of ",[32,511,452],{}," by writing the names of files you do not want to be committed into that file.",[25,514,516],{"className":27,"code":515,"language":29,"meta":30,"style":30},"vim .gitignore\ngit status\n",[32,517,518,524],{"__ignoreMap":30},[35,519,520,522],{"class":37,"line":38},[35,521,236],{"class":41},[35,523,475],{"class":45},[35,525,526,528],{"class":37,"line":52},[35,527,68],{"class":41},[35,529,288],{"class":45},[74,531,532],{},[77,533],{"alt":30,"src":534},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage18.webp",[74,536,537],{},[77,538],{"alt":30,"src":539},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage19.webp",[85,541,543],{"id":542},"basic-branch-operations","Basic Branch Operations",[15,545,546,549],{},[18,547,548],{},"The role of a branch: it creates a new repository branch for a project, which is independent from other branches like master. You can perform independent add, commit, diff, and clone operations on it.",[18,550,551],{},"Create a branch",[25,553,555],{"className":27,"code":554,"language":29,"meta":30,"style":30},"git branch route2\n#git branch 分支名\n",[32,556,557,567],{"__ignoreMap":30},[35,558,559,561,564],{"class":37,"line":38},[35,560,68],{"class":41},[35,562,563],{"class":45}," branch",[35,565,566],{"class":45}," route2\n",[35,568,569],{"class":37,"line":52},[35,570,571],{"class":353},"#git branch 分支名\n",[15,573,574],{"start":65},[18,575,576],{},"Enter the branch",[25,578,580],{"className":27,"code":579,"language":29,"meta":30,"style":30},"git checkout route2\n#git checkout 分支名\n",[32,581,582,591],{"__ignoreMap":30},[35,583,584,586,589],{"class":37,"line":38},[35,585,68],{"class":41},[35,587,588],{"class":45}," checkout",[35,590,566],{"class":45},[35,592,593],{"class":37,"line":52},[35,594,595],{"class":353},"#git checkout 分支名\n",[15,597,598],{"start":426},[18,599,600],{},"Query how many branches there are, and check which branch is currently active.",[25,602,604],{"className":27,"code":603,"language":29,"meta":30,"style":30},"git branch\n",[32,605,606],{"__ignoreMap":30},[35,607,608,610],{"class":37,"line":38},[35,609,68],{"class":41},[35,611,612],{"class":45}," branch\n",[74,614,615],{},[77,616],{"alt":30,"src":617},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage20.webp",[74,619,620],{},"The current branch's files will perfectly inherit the files from the master branch.",[15,622,624],{"start":623},5,[18,625,626],{},"Delete the files under this branch.",[25,628,630],{"className":27,"code":629,"language":29,"meta":30,"style":30},"ls\nrm -rf test.md\nrm -rf vinci_secret.py\nls\n",[32,631,632,636,646,654],{"__ignoreMap":30},[35,633,634],{"class":37,"line":38},[35,635,198],{"class":41},[35,637,638,641,644],{"class":37,"line":52},[35,639,640],{"class":41},"rm",[35,642,643],{"class":71}," -rf",[35,645,193],{"class":45},[35,647,648,650,652],{"class":37,"line":65},[35,649,640],{"class":41},[35,651,643],{"class":71},[35,653,482],{"class":45},[35,655,656],{"class":37,"line":426},[35,657,198],{"class":41},[74,659,660],{},[77,661],{"alt":30,"src":662},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage21.webp",[15,664,666],{"start":665},6,[18,667,668],{},"Commit this branch to the local repository.",[25,670,672],{"className":27,"code":671,"language":29,"meta":30,"style":30},"git commit -a -m \"删库跑路\"\n#该指令是把git add和git commit指令一起写\n",[32,673,674,688],{"__ignoreMap":30},[35,675,676,678,680,683,685],{"class":37,"line":38},[35,677,68],{"class":41},[35,679,338],{"class":45},[35,681,682],{"class":71}," -a",[35,684,341],{"class":71},[35,686,687],{"class":45}," \"删库跑路\"\n",[35,689,690],{"class":37,"line":52},[35,691,692],{"class":353},"#该指令是把git add和git commit指令一起写\n",[74,694,695],{},[77,696],{"alt":30,"src":697},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage22.webp",[15,699,701],{"start":700},7,[18,702,703],{},"Check whether the branch affects other branches (switch to another branch to see the impact).",[25,705,707],{"className":27,"code":706,"language":29,"meta":30,"style":30},"git checkout master\nls\n",[32,708,709,718],{"__ignoreMap":30},[35,710,711,713,715],{"class":37,"line":38},[35,712,68],{"class":41},[35,714,588],{"class":45},[35,716,717],{"class":45}," master\n",[35,719,720],{"class":37,"line":52},[35,721,198],{"class":41},[74,723,724],{},[77,725],{"alt":30,"src":726},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage23.webp",[74,728,729,730,733,734,737,738,741,742,744],{},"It can be seen that the deleted ",[32,731,732],{},"test.md"," file has reappeared in the ",[32,735,736],{},"route2"," branch, but the similarly deleted ",[32,739,740],{},"vinci_sercet.py"," file has not. This is because that file was excluded by the ",[32,743,452],{}," file during the commit and will not be added to the local repository.",[15,746,748],{"start":747},8,[18,749,750],{},"Delete branch",[25,752,754],{"className":27,"code":753,"language":29,"meta":30,"style":30},"git branch -D route2\n#git branch -D 分支名\n",[32,755,756,767],{"__ignoreMap":30},[35,757,758,760,762,765],{"class":37,"line":38},[35,759,68],{"class":41},[35,761,563],{"class":45},[35,763,764],{"class":71}," -D",[35,766,566],{"class":45},[35,768,769],{"class":37,"line":52},[35,770,771],{"class":353},"#git branch -D 分支名\n",[74,773,774],{},[77,775],{"alt":30,"src":776},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage24.webp",[15,778,780],{"start":779},9,[18,781,782],{},"Create a branch and switch to it immediately.",[25,784,786],{"className":27,"code":785,"language":29,"meta":30,"style":30},"git checkout -b route3\n",[32,787,788],{"__ignoreMap":30},[35,789,790,792,794,797],{"class":37,"line":38},[35,791,68],{"class":41},[35,793,588],{"class":45},[35,795,796],{"class":71}," -b",[35,798,799],{"class":45}," route3\n",[74,801,802],{},[77,803],{"alt":30,"src":804},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage25.webp",[85,806,808],{"id":807},"merging-branches","Merging branches",[15,810,811],{},[18,812,813],{},"Modify the file content in the route3 branch and commit it.",[25,815,817],{"className":27,"code":816,"language":29,"meta":30,"style":30},"vim test.md\ngit commit -am \"route3 version3\"\n#-a -m也可以被省略成-am\n",[32,818,819,825,837],{"__ignoreMap":30},[35,820,821,823],{"class":37,"line":38},[35,822,236],{"class":41},[35,824,193],{"class":45},[35,826,827,829,831,834],{"class":37,"line":52},[35,828,68],{"class":41},[35,830,338],{"class":45},[35,832,833],{"class":71}," -am",[35,835,836],{"class":45}," \"route3 version3\"\n",[35,838,839],{"class":37,"line":65},[35,840,841],{"class":353},"#-a -m也可以被省略成-am\n",[74,843,844],{},[77,845],{"alt":30,"src":846},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage26.webp",[74,848,849],{},[77,850],{"alt":30,"src":851},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage27.webp",[15,853,854],{"start":52},[18,855,856],{},"Switch to the master branch.",[25,858,860],{"className":27,"code":859,"language":29,"meta":30,"style":30},"git checkout master\nvim test.md\n",[32,861,862,870],{"__ignoreMap":30},[35,863,864,866,868],{"class":37,"line":38},[35,865,68],{"class":41},[35,867,588],{"class":45},[35,869,717],{"class":45},[35,871,872,874],{"class":37,"line":52},[35,873,236],{"class":41},[35,875,193],{"class":45},[74,877,878],{},[77,879],{"alt":30,"src":880},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage28.webp",[15,882,883],{"start":65},[18,884,885],{},"Merge the route3 branch into the current branch.",[25,887,889],{"className":27,"code":888,"language":29,"meta":30,"style":30},"git merge route3\n#git merge 被合并的分支名\nvim test.md\n",[32,890,891,900,905],{"__ignoreMap":30},[35,892,893,895,898],{"class":37,"line":38},[35,894,68],{"class":41},[35,896,897],{"class":45}," merge",[35,899,799],{"class":45},[35,901,902],{"class":37,"line":52},[35,903,904],{"class":353},"#git merge 被合并的分支名\n",[35,906,907,909],{"class":37,"line":65},[35,908,236],{"class":41},[35,910,193],{"class":45},[74,912,913],{},[77,914],{"alt":30,"src":915},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage29.webp",[74,917,918],{},[77,919],{"alt":30,"src":920},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage30.webp",[85,922,924],{"id":923},"merge-conflict-in-branch","Merge conflict in branch",[15,926,927],{},[18,928,929],{},"Add a line of content to master and commit it.",[25,931,933],{"className":27,"code":932,"language":29,"meta":30,"style":30},"vim test.md\ngit commit -am \"master version4\"\n",[32,934,935,941],{"__ignoreMap":30},[35,936,937,939],{"class":37,"line":38},[35,938,236],{"class":41},[35,940,193],{"class":45},[35,942,943,945,947,949],{"class":37,"line":52},[35,944,68],{"class":41},[35,946,338],{"class":45},[35,948,833],{"class":71},[35,950,951],{"class":45}," \"master version4\"\n",[74,953,954],{},[77,955],{"alt":30,"src":956},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage31.webp",[74,958,959],{},[77,960],{"alt":30,"src":961},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage32.webp",[15,963,964],{"start":52},[18,965,966],{},"Switch to the route3 branch, add content, and commit.",[25,968,970],{"className":27,"code":969,"language":29,"meta":30,"style":30},"git checkout route3\nvim test.md\ngit commit -am \"route3 version4\"\n",[32,971,972,980,986],{"__ignoreMap":30},[35,973,974,976,978],{"class":37,"line":38},[35,975,68],{"class":41},[35,977,588],{"class":45},[35,979,799],{"class":45},[35,981,982,984],{"class":37,"line":52},[35,983,236],{"class":41},[35,985,193],{"class":45},[35,987,988,990,992,994],{"class":37,"line":65},[35,989,68],{"class":41},[35,991,338],{"class":45},[35,993,833],{"class":71},[35,995,996],{"class":45}," \"route3 version4\"\n",[74,998,999],{},[77,1000],{"alt":30,"src":1001},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage33.webp",[74,1003,1004],{},[77,1005],{"alt":30,"src":1006},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage34.webp",[15,1008,1009],{"start":65},[18,1010,1011],{},"Merge branch",[25,1013,1015],{"className":27,"code":1014,"language":29,"meta":30,"style":30},"git merge master\n",[32,1016,1017],{"__ignoreMap":30},[35,1018,1019,1021,1023],{"class":37,"line":38},[35,1020,68],{"class":41},[35,1022,897],{"class":45},[35,1024,717],{"class":45},[74,1026,1027],{},[77,1028],{"alt":30,"src":1029},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage35.webp",[74,1031,1032],{},"A content conflict has occurred. You need to manually resolve the text conflict! Alternatively, other methods can also solve it — you can search Baidu for help.",[85,1034,1036],{"id":1035},"remote-repository-github","Remote repository GitHub",[15,1038,1039,1048],{},[18,1040,1041,1042],{},"Open the GitHub official website: ",[385,1043,1047],{"href":1044,"rel":1045},"https:\u002F\u002Fgithub.com(%E5%A6%82%E6%9E%9C%E4%BD%A0%E6%89%93%E4%B8%8D%E5%BC%80%EF%BC%8C%E8%AF%B7%E8%87%AA%E5%B7%B1%E6%89%BE%E5%8A%9E%E6%B3%95%E6%89%93%E5%BC%80)",[1046],"nofollow","https:\u002F\u002Fgithub.com(如果你打不开，请自己找办法打开)",[18,1049,1050],{},"Register and log in to your account.",[74,1052,1053],{},[77,1054],{"alt":30,"src":1055},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage36.webp",[15,1057,1058],{"start":65},[18,1059,1060],{},"Create a new remote repository",[74,1062,1063],{},[77,1064],{"alt":30,"src":1065},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage37.webp",[74,1067,1068],{},[77,1069],{"alt":30,"src":1070},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage38.webp",[74,1072,1073],{},"It is recommended to configure this interface in detail, but since this is a demo, only the repository name has been set, and all other options remain at their default values.",[74,1075,1076],{},[77,1077],{"alt":30,"src":1078},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage39.webp",[74,1080,1081],{},"If the image above appears, it means the creation was successful.",[15,1083,1084],{"start":426},[18,1085,1086],{},"Create a file and commit it.",[74,1088,1089],{},[77,1090],{"alt":30,"src":1091},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage40.webp",[74,1093,1094],{},[77,1095],{"alt":30,"src":1096},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage41.webp",[74,1098,1099],{},"Fill in the file name and file content, then click the green button to submit. You can also fill in a commit comment.",[74,1101,1102],{},[77,1103],{"alt":30,"src":1104},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage42.webp",[74,1106,1107],{},[77,1108],{"alt":30,"src":1109},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage43.webp",[15,1111,1112],{"start":623},[18,1113,1114],{},"Clone the remote repository to your local machine.",[74,1116,1117],{},[77,1118],{"alt":30,"src":1119},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage44.webp",[25,1121,1123],{"className":27,"code":1122,"language":29,"meta":30,"style":30},"cd\nmkdir repo_floder\ncd repo_floder\ngit clone https:\u002F\u002Fgithub.com\u002Ftungchiahui\u002Ftest_repo.git\n",[32,1124,1125,1130,1137,1143],{"__ignoreMap":30},[35,1126,1127],{"class":37,"line":38},[35,1128,1129],{"class":71},"cd\n",[35,1131,1132,1134],{"class":37,"line":52},[35,1133,98],{"class":41},[35,1135,1136],{"class":45}," repo_floder\n",[35,1138,1139,1141],{"class":37,"line":65},[35,1140,109],{"class":71},[35,1142,1136],{"class":45},[35,1144,1145,1147,1150],{"class":37,"line":426},[35,1146,68],{"class":41},[35,1148,1149],{"class":45}," clone",[35,1151,1152],{"class":45}," https:\u002F\u002Fgithub.com\u002Ftungchiahui\u002Ftest_repo.git\n",[74,1154,1155],{},[77,1156],{"alt":30,"src":1157},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage45.webp",[74,1159,1160],{},"If you encounter an error, please check whether you can access GitHub normally!",[74,1162,1163,1166],{},[77,1164],{"alt":30,"src":1165},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage46.webp",[77,1167],{"alt":30,"src":1168},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage47.webp",[15,1170,1171],{"start":665},[18,1172,1173],{},"Modify the file content.",[25,1175,1177],{"className":27,"code":1176,"language":29,"meta":30,"style":30},"cd test_repo\nvim test1.md\n",[32,1178,1179,1186],{"__ignoreMap":30},[35,1180,1181,1183],{"class":37,"line":38},[35,1182,109],{"class":71},[35,1184,1185],{"class":45}," test_repo\n",[35,1187,1188,1190],{"class":37,"line":52},[35,1189,236],{"class":41},[35,1191,1192],{"class":45}," test1.md\n",[74,1194,1195],{},[77,1196],{"alt":30,"src":1197},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage48.webp",[74,1199,1200],{},[77,1201],{"alt":30,"src":1202},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage49.webp",[74,1204,1205],{},[77,1206],{"alt":30,"src":1207},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage50.webp",[15,1209,1210],{"start":700},[18,1211,1212],{},"Check which remote repositories this local repository is connected to.",[25,1214,1216],{"className":27,"code":1215,"language":29,"meta":30,"style":30},"git remote -v\n",[32,1217,1218],{"__ignoreMap":30},[35,1219,1220,1222,1225],{"class":37,"line":38},[35,1221,68],{"class":41},[35,1223,1224],{"class":45}," remote",[35,1226,1227],{"class":71}," -v\n",[74,1229,1230],{},[77,1231],{"alt":30,"src":1232},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage51.webp",[15,1234,1235],{"start":747},[18,1236,1237],{},"Push the local repository to the remote repository.",[25,1239,1241],{"className":27,"code":1240,"language":29,"meta":30,"style":30},"git push\n",[32,1242,1243],{"__ignoreMap":30},[35,1244,1245,1247],{"class":37,"line":38},[35,1246,68],{"class":41},[35,1248,1249],{"class":45}," push\n",[74,1251,1252],{},[77,1253],{"alt":30,"src":1254},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage52.webp",[74,1256,1257],{},"Here you need to enter your GitHub username and password. The username is your GitHub username, but the password is your GitHub user token. The steps to generate a token are as follows:",[74,1259,1260,1263],{},[77,1261],{"alt":30,"src":1262},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage53.webp",[77,1264],{"alt":30,"src":1265},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage54.webp",[74,1267,1268],{},[77,1269],{"alt":30,"src":1270},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage55.webp",[74,1272,1273],{},[77,1274],{"alt":30,"src":1275},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage56.webp",[74,1277,1278],{},"Note can be filled in arbitrarily; for the expiration date, select \"No expiration date.\"",[74,1280,1281],{},"Check all the boxes below that can be checked — these are the permissions.",[74,1283,1284],{},[77,1285],{"alt":30,"src":1286},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage57.webp",[74,1288,1289],{},"Copy the token and paste it into the password field (the token will be hidden when typed in the terminal; just press Enter after entering it).",[74,1291,1292],{},[77,1293],{"alt":30,"src":1294},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage58.webp",[15,1296,1297],{"start":779},[18,1298,1299],{},"View the remote repository",[74,1301,1302],{},[77,1303],{"alt":30,"src":1304},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage59.webp",[74,1306,1307],{},"The file has been modified!",[15,1309,1311],{"start":1310},10,[18,1312,1313],{},"Modify the content of the remote repository.",[74,1315,1316],{},[77,1317],{"alt":30,"src":1318},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage60.webp",[15,1320,1322],{"start":1321},11,[18,1323,1324],{},"Pull the remote repository content to the local repository.",[25,1326,1328],{"className":27,"code":1327,"language":29,"meta":30,"style":30},"git fetch\n",[32,1329,1330],{"__ignoreMap":30},[35,1331,1332,1334],{"class":37,"line":38},[35,1333,68],{"class":41},[35,1335,1336],{"class":45}," fetch\n",[74,1338,1339],{},[77,1340],{"alt":30,"src":1341},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage61.webp",[15,1343,1345],{"start":1344},12,[18,1346,1347],{},"View the differences between the local and remote repositories.",[25,1349,1351],{"className":27,"code":1350,"language":29,"meta":30,"style":30},"git diff origin\u002Fmain\n#git diff 远程仓库名\u002F分支名\n",[32,1352,1353,1363],{"__ignoreMap":30},[35,1354,1355,1357,1360],{"class":37,"line":38},[35,1356,68],{"class":41},[35,1358,1359],{"class":45}," diff",[35,1361,1362],{"class":45}," origin\u002Fmain\n",[35,1364,1365],{"class":37,"line":52},[35,1366,1367],{"class":353},"#git diff 远程仓库名\u002F分支名\n",[74,1369,1370],{},[77,1371],{"alt":30,"src":1372},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage62.webp",[15,1374,1376],{"start":1375},13,[18,1377,1378],{},"If the content is fine, you can sync the remote repository to the workspace.",[25,1380,1382],{"className":27,"code":1381,"language":29,"meta":30,"style":30},"git pull\n",[32,1383,1384],{"__ignoreMap":30},[35,1385,1386,1388],{"class":37,"line":38},[35,1387,68],{"class":41},[35,1389,1390],{"class":45}," pull\n",[74,1392,1393],{},[77,1394],{"alt":30,"src":1395},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage63.webp",[15,1397,1399],{"start":1398},14,[18,1400,1401],{},"View the project modification history.",[25,1403,1404],{"className":27,"code":366,"language":29,"meta":30,"style":30},[32,1405,1406],{"__ignoreMap":30},[35,1407,1408,1410],{"class":37,"line":38},[35,1409,68],{"class":41},[35,1411,375],{"class":45},[74,1413,1414],{},[77,1415],{"alt":30,"src":1416},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage64.webp",[85,1418,1420],{"id":1419},"使用pull-request合并代码","使用Pull Request合并代码",[74,1422,1423],{},"Pull Request简称PR，用于请求将一个分支中的修改合并到另一个分支。PR可以让项目成员在合并前查看代码变化、留言讨论和进行审查，因此团队协作时通常不会直接将未审查的代码push到main分支。",[15,1425,1426],{},[18,1427,1428],{},"从main分支创建并进入一个功能分支",[25,1430,1432],{"className":27,"code":1431,"language":29,"meta":30,"style":30},"git checkout main\ngit pull origin main\ngit checkout -b feature\u002Fpr-demo\n",[32,1433,1434,1443,1455],{"__ignoreMap":30},[35,1435,1436,1438,1440],{"class":37,"line":38},[35,1437,68],{"class":41},[35,1439,588],{"class":45},[35,1441,1442],{"class":45}," main\n",[35,1444,1445,1447,1450,1453],{"class":37,"line":52},[35,1446,68],{"class":41},[35,1448,1449],{"class":45}," pull",[35,1451,1452],{"class":45}," origin",[35,1454,1442],{"class":45},[35,1456,1457,1459,1461,1463],{"class":37,"line":65},[35,1458,68],{"class":41},[35,1460,588],{"class":45},[35,1462,796],{"class":71},[35,1464,1465],{"class":45}," feature\u002Fpr-demo\n",[74,1467,1468,1471],{},[32,1469,1470],{},"feature\u002Fpr-demo","是本次示例的分支名，实际开发时应使用能表达修改内容的名称。",[15,1473,1474],{"start":52},[18,1475,1476],{},"修改文件并提交到本地仓库",[25,1478,1480],{"className":27,"code":1479,"language":29,"meta":30,"style":30},"vim test1.md\n",[32,1481,1482],{"__ignoreMap":30},[35,1483,1484,1486],{"class":37,"line":38},[35,1485,236],{"class":41},[35,1487,1192],{"class":45},[74,1489,1490,1491,1494],{},"按下",[32,1492,1493],{},"insert","按键,然后随便输入点正文.",[74,1496,1497],{},"For example",[25,1499,1504],{"className":1500,"code":1502,"language":1503,"meta":30},[1501],"language-text","TEST11111\n","text",[32,1505,1502],{"__ignoreMap":30},[74,1507,1508],{},[77,1509],{"alt":30,"src":1510},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787064333936-11c1cbc1.webp",[74,1512,1513,1514,1517,1518,1521],{},"然后按下",[32,1515,1516],{},"ESC",",再输入",[32,1519,1520],{},":wq","进行保存.",[25,1523,1525],{"className":27,"code":1524,"language":29,"meta":30,"style":30},"git add test1.md\ngit commit -m \"修改test1文件\"\n",[32,1526,1527,1535],{"__ignoreMap":30},[35,1528,1529,1531,1533],{"class":37,"line":38},[35,1530,68],{"class":41},[35,1532,315],{"class":45},[35,1534,1192],{"class":45},[35,1536,1537,1539,1541,1543],{"class":37,"line":52},[35,1538,68],{"class":41},[35,1540,338],{"class":45},[35,1542,341],{"class":71},[35,1544,1545],{"class":45}," \"修改test1文件\"\n",[15,1547,1548],{"start":65},[18,1549,1550],{},"将功能分支推送到Github",[25,1552,1554],{"className":27,"code":1553,"language":29,"meta":30,"style":30},"git push -u origin feature\u002Fpr-demo\n",[32,1555,1556],{"__ignoreMap":30},[35,1557,1558,1560,1563,1566,1568],{"class":37,"line":38},[35,1559,68],{"class":41},[35,1561,1562],{"class":45}," push",[35,1564,1565],{"class":71}," -u",[35,1567,1452],{"class":45},[35,1569,1465],{"class":45},[74,1571,1572,1575,1576,1579],{},[32,1573,1574],{},"-u","会建立本地分支与远程分支的跟踪关系，之后在该分支上可以直接使用",[32,1577,1578],{},"git push","。",[74,1581,1582],{},[77,1583],{"alt":30,"src":1584},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787064461783-99e8dd17.webp",[15,1586,1587],{"start":426},[18,1588,1589],{},"在Github仓库页面创建PR",[74,1591,1592,1593,1596,1597,1600,1601,1579],{},"推送新分支后，Github仓库页面通常会显示",[32,1594,1595],{},"Compare & pull request","按钮，点击该按钮。如果没有显示，也可以进入仓库的",[32,1598,1599],{},"Pull requests","页面，点击",[32,1602,1603],{},"New pull request",[74,1605,1606],{},[77,1607],{"alt":30,"src":1608},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787064906162-71445eaa.webp",[74,1610,1611],{},"确认两个分支选择正确：",[1613,1614,1615],"ul",{},[18,1616,1617,1620],{},[32,1618,1619],{},"base: main","：修改最终要合并到的目标分支。",[1613,1622,1623],{},[18,1624,1625,1628],{},[32,1626,1627],{},"compare: feature\u002Fpr-demo","：包含本次修改的来源分支。",[74,1630,1631,1632,1579],{},"PR只能在两个不同的分支之间创建。确认下方显示的提交和文件变化没有问题后，填写PR标题和说明，再点击",[32,1633,1634],{},"Create pull request",[74,1636,1637],{},[77,1638],{"alt":30,"src":1639},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787064943146-74bb95c8.webp",[15,1641,1642],{"start":623},[18,1643,1644],{},"审查并继续修改PR",[74,1646,1647,1648,1651],{},"创建PR后，可以在",[32,1649,1650],{},"Files changed","页面查看本次修改，也可以邀请其他项目成员进行Review。",[74,1653,1654],{},[77,1655],{"alt":30,"src":1656},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787064981492-31b0d73a.webp",[74,1658,1659],{},[77,1660],{"alt":30,"src":1661},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065005428-a0e83f50.webp",[74,1663,1664],{},"如果审查后需要继续修改，不需要重新创建PR。只需在同一个功能分支上继续提交并push，新的提交会自动加入当前PR。",[25,1666,1667],{"className":27,"code":1479,"language":29,"meta":30,"style":30},[32,1668,1669],{"__ignoreMap":30},[35,1670,1671,1673],{"class":37,"line":38},[35,1672,236],{"class":41},[35,1674,1192],{"class":45},[74,1676,1490,1677,1679],{},[32,1678,1493],{},"按键,然后修改下正文.",[74,1681,1497],{},[25,1683,1686],{"className":1684,"code":1685,"language":1503,"meta":30},[1501],"TEST222\n",[32,1687,1685],{"__ignoreMap":30},[74,1689,1690],{},[77,1691],{"alt":30,"src":1692},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065067042-e6c639e5.webp",[74,1694,1513,1695,1517,1697,1521],{},[32,1696,1516],{},[32,1698,1520],{},[25,1700,1702],{"className":27,"code":1701,"language":29,"meta":30,"style":30},"git add test1.md\ngit commit -m \"根据Review意见修改\"\ngit push\n",[32,1703,1704,1712,1723],{"__ignoreMap":30},[35,1705,1706,1708,1710],{"class":37,"line":38},[35,1707,68],{"class":41},[35,1709,315],{"class":45},[35,1711,1192],{"class":45},[35,1713,1714,1716,1718,1720],{"class":37,"line":52},[35,1715,68],{"class":41},[35,1717,338],{"class":45},[35,1719,341],{"class":71},[35,1721,1722],{"class":45}," \"根据Review意见修改\"\n",[35,1724,1725,1727],{"class":37,"line":65},[35,1726,68],{"class":41},[35,1728,1249],{"class":45},[74,1730,1731],{},"你会发现又多了一个commit如下图.",[74,1733,1734],{},[77,1735],{"alt":30,"src":1736},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065285593-fd34b4ab.webp",[74,1738,1739,1740,1742],{},"点击",[32,1741,1650],{},"页面查看本次修改:",[74,1744,1745],{},[77,1746],{"alt":30,"src":1747},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065330682-5a3c24b2.webp",[15,1749,1750],{},[18,1751,1752],{},"合并PR",[74,1754,1755,1756,1759,1760,1763],{},"审查通过且代码没有冲突时，拥有仓库写入权限的成员可以点击",[32,1757,1758],{},"Merge pull request","，再点击",[32,1761,1762],{},"Confirm merge","完成合并。仓库如果设置了审查或自动测试规则，需要先满足这些条件才能合并。",[74,1765,1766],{},[77,1767],{"alt":30,"src":1768},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065354582-4983dc9a.webp",[74,1770,1771],{},[77,1772],{"alt":30,"src":1773},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065535509-f5281ba6.webp",[15,1775,1776],{"start":52},[18,1777,1778],{},"同步main分支并删除已合并的分支",[74,1780,1781,1782,1784],{},"合并成功后，可以在PR页面点击",[32,1783,750],{},"删除Github上的功能分支。然后返回终端，更新本地main分支并删除本地功能分支。",[74,1786,1787],{},[77,1788],{"alt":30,"src":1789},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065902706-8963e001.webp",[74,1791,1792],{},[77,1793],{"alt":30,"src":1794},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065920575-e0e74498.webp",[25,1796,1798],{"className":27,"code":1797,"language":29,"meta":30,"style":30},"git checkout main\ngit pull origin main\ngit branch -d feature\u002Fpr-demo\n",[32,1799,1800,1808,1818],{"__ignoreMap":30},[35,1801,1802,1804,1806],{"class":37,"line":38},[35,1803,68],{"class":41},[35,1805,588],{"class":45},[35,1807,1442],{"class":45},[35,1809,1810,1812,1814,1816],{"class":37,"line":52},[35,1811,68],{"class":41},[35,1813,1449],{"class":45},[35,1815,1452],{"class":45},[35,1817,1442],{"class":45},[35,1819,1820,1822,1824,1827],{"class":37,"line":65},[35,1821,68],{"class":41},[35,1823,563],{"class":45},[35,1825,1826],{"class":71}," -d",[35,1828,1465],{"class":45},[74,1830,1831],{},[77,1832],{"alt":30,"src":1833},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787065949628-3cbeb701.webp",[85,1835,1837],{"id":1836},"向没有写入权限的仓库提交pr","向没有写入权限的仓库提交PR",[74,1839,1840,1841,1844],{},"如果想向其他人的开源项目贡献代码，通常没有权限直接将分支push到对方的仓库。此时需要先在Github上点击",[32,1842,1843],{},"Fork","，将该仓库复制到自己的账号下。",[74,1846,1847],{},"Fork完成后，克隆自己的仓库并记录原仓库地址：",[25,1849,1851],{"className":27,"code":1850,"language":29,"meta":30,"style":30},"git clone https:\u002F\u002Fgithub.com\u002F你的Github用户名\u002F仓库名.git\ncd 仓库名\ngit remote add upstream https:\u002F\u002Fgithub.com\u002F原仓库用户名\u002F仓库名.git\ngit remote -v\n",[32,1852,1853,1862,1869,1883],{"__ignoreMap":30},[35,1854,1855,1857,1859],{"class":37,"line":38},[35,1856,68],{"class":41},[35,1858,1149],{"class":45},[35,1860,1861],{"class":45}," https:\u002F\u002Fgithub.com\u002F你的Github用户名\u002F仓库名.git\n",[35,1863,1864,1866],{"class":37,"line":52},[35,1865,109],{"class":71},[35,1867,1868],{"class":45}," 仓库名\n",[35,1870,1871,1873,1875,1877,1880],{"class":37,"line":65},[35,1872,68],{"class":41},[35,1874,1224],{"class":45},[35,1876,315],{"class":45},[35,1878,1879],{"class":45}," upstream",[35,1881,1882],{"class":45}," https:\u002F\u002Fgithub.com\u002F原仓库用户名\u002F仓库名.git\n",[35,1884,1885,1887,1889],{"class":37,"line":426},[35,1886,68],{"class":41},[35,1888,1224],{"class":45},[35,1890,1227],{"class":71},[74,1892,1893,1894,1897,1898,1901],{},"其中",[32,1895,1896],{},"origin","指向自己Fork出来的仓库，",[32,1899,1900],{},"upstream","指向原仓库。接下来仍然需要创建功能分支，不要直接在main分支上修改。",[25,1903,1905],{"className":27,"code":1904,"language":29,"meta":30,"style":30},"git checkout -b feature\u002Fpr-demo\n# 修改文件后提交\ngit add .\ngit commit -m \"添加示例功能\"\ngit push -u origin feature\u002Fpr-demo\n",[32,1906,1907,1917,1922,1931,1942],{"__ignoreMap":30},[35,1908,1909,1911,1913,1915],{"class":37,"line":38},[35,1910,68],{"class":41},[35,1912,588],{"class":45},[35,1914,796],{"class":71},[35,1916,1465],{"class":45},[35,1918,1919],{"class":37,"line":52},[35,1920,1921],{"class":353},"# 修改文件后提交\n",[35,1923,1924,1926,1928],{"class":37,"line":65},[35,1925,68],{"class":41},[35,1927,315],{"class":45},[35,1929,1930],{"class":45}," .\n",[35,1932,1933,1935,1937,1939],{"class":37,"line":426},[35,1934,68],{"class":41},[35,1936,338],{"class":45},[35,1938,341],{"class":71},[35,1940,1941],{"class":45}," \"添加示例功能\"\n",[35,1943,1944,1946,1948,1950,1952],{"class":37,"line":623},[35,1945,68],{"class":41},[35,1947,1562],{"class":45},[35,1949,1565],{"class":71},[35,1951,1452],{"class":45},[35,1953,1465],{"class":45},[74,1955,1956],{},"推送后在Github上创建PR，并特别确认：",[1613,1958,1959],{},[18,1960,1961,1964,1965,1968],{},[32,1962,1963],{},"base repository","是对方的原仓库，",[32,1966,1967],{},"base","是对方要接收修改的分支。",[1613,1970,1971],{},[18,1972,1973,1976,1977,1980],{},[32,1974,1975],{},"head repository","是自己Fork的仓库，",[32,1978,1979],{},"compare","是自己刚刚推送的功能分支。",[74,1982,1983,1984,1986],{},"之后填写标题和修改说明，点击",[32,1985,1634],{},"即可向原项目提交PR。",[10,1988,1990],{"id":1989},"vscode-git","VScode + Git",[85,1992,1994],{"id":1993},"what-is-vscode","What is VScode?",[74,1996,1997],{},"VScode is a text editor, similar to editors like Vim, but it has a graphical interface, a wide variety of useful plugins, and can integrate a compiler environment. Ultimately, it can be customized by users into an IDE like Visual Studio.",[85,1999,2001],{"id":2000},"vscode-official-website","VScode official website:",[74,2003,2004],{},[385,2005,2006],{"href":2006,"rel":2007},"https:\u002F\u002Fcode.visualstudio.com\u002F",[1046],[85,2009,2011],{"id":2010},"create-a-folder-and-open-vscode-in-that-folder","Create a folder and open VSCode in that folder.",[74,2013,2014],{},[77,2015],{"alt":30,"src":2016},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage65.webp",[85,2018,2020],{"id":2019},"create-a-new-file","Create a new file",[74,2022,2023],{},[77,2024],{"alt":30,"src":2025},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage66.webp",[74,2027,2028],{},[77,2029],{"alt":30,"src":2030},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage67.webp",[85,2032,2034,2035,2038],{"id":2033},"initialize-git-similar-to-the-git-init-command","Initialize Git (similar to the ",[32,2036,2037],{},"git init"," command)",[74,2040,2041],{},[77,2042],{"alt":30,"src":2043},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage68.webp",[74,2045,2046],{},[77,2047],{"alt":30,"src":2048},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage69.webp",[74,2050,2051],{},"U stands for untracked status, meaning the file is still in the working directory.",[85,2053,2055,2056,2059],{"id":2054},"stage-the-file-similar-to-git-add","Stage the file (similar to ",[32,2057,2058],{},"git add",")",[74,2061,2062],{},[77,2063],{"alt":30,"src":2064},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage70.webp",[85,2066,2068],{"id":2067},"to-cancel-staging-click-the-minus-sign-this-does-not-cancel","To cancel staging, click the minus sign (this does not cancel).",[74,2070,2071],{},[77,2072],{"alt":30,"src":2073},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage71.webp",[74,2075,2076],{},"A is \"added,\" meaning it is in the staging area.",[85,2078,2080],{"id":2079},"submit-similar-to-commit","Submit (similar to commit)",[74,2082,2083],{},[77,2084],{"alt":30,"src":2085},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage72.webp",[74,2087,2088],{},"Enter the commit message and click the checkmark to commit.",[85,2090,2092],{"id":2091},"create-a-new-branch-and-switch-to-it","Create a new branch and switch to it.",[74,2094,2095],{},[77,2096],{"alt":30,"src":2097},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage73.webp",[74,2099,2100],{},[77,2101],{"alt":30,"src":2102},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage74.webp",[85,2104,2106],{"id":2105},"modified-content","Modified content",[74,2108,2109],{},[77,2110],{"alt":30,"src":2111},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage75.webp",[74,2113,2114],{},"Display M as modified status",[85,2116,2118],{"id":2117},"view-historical-version-comparison-click-on-file","View historical version comparison (click on file)",[74,2120,2121],{},[77,2122],{"alt":30,"src":2123},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage76.webp",[85,2125,2127],{"id":2126},"submit","Submit",[74,2129,2130],{},[77,2131],{"alt":30,"src":2132},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage77.webp",[85,2134,2136],{"id":2135},"switch-back-to-the-main-branch","Switch back to the main branch.",[74,2138,2139],{},[77,2140],{"alt":30,"src":2141},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage78.webp",[74,2143,2144],{},[77,2145],{"alt":30,"src":2146},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage79.webp",[85,2148,1011],{"id":2149},"merge-branch",[74,2151,2152],{},[77,2153],{"alt":30,"src":2154},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage80.webp",[74,2156,2157],{},[77,2158],{"alt":30,"src":2159},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage81.webp",[74,2161,2162],{},[77,2163],{"alt":30,"src":2164},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage82.webp",[85,2166,2168],{"id":2167},"push-to-the-remote-github-repository","Push to the remote GitHub repository",[15,2170,2171],{},[18,2172,2173,2174,2177,2178,2181],{},"在下面这个界面找到 ",[32,2175,2176],{},"Publish to Github",",可能会弹出来点击",[32,2179,2180],{},"Sign In","，然后按提示在浏览器中完成Github授权。",[74,2183,2184],{},[77,2185],{"alt":30,"src":2186},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067081290-b1e5b2ef.webp",[15,2188,2189],{"start":52},[18,2190,2191],{},"Please provide the Markdown fragment you'd like me to translate.",[74,2193,2194],{},[77,2195],{"alt":30,"src":2196},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage83.webp",[74,2198,2199],{},[77,2200],{"alt":30,"src":2201},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage84.webp",[15,2203,2204],{"start":65},[18,2205,2206],{},"Open the GitHub repository to view it.",[74,2208,2209],{},[77,2210],{"alt":30,"src":2211},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage85.webp",[74,2213,2214],{},[77,2215],{"alt":30,"src":2216},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002Fimage86.webp",[85,2218,2220],{"id":2219},"使用vscode图形化提交pull-request","使用VScode图形化提交Pull Request",[74,2222,2223],{},"本节演示如何使用VScode创建、审查和合并Pull Request，整个过程不需要在终端输入Git指令。",[2225,2226,2227],"blockquote",{},[74,2228,2229],{},"注意：如果要使用Pull Request，功能分支提交完成后不要执行上文的“切换回main分支”和“合并分支”操作。应当将功能分支保持独立，通过PR审查后再合并到main分支。",[15,2231,2232],{},[18,2233,2234],{},"安装Github Pull Requests扩展",[74,2236,2237,2238,2241,2242,2244],{},"打开VScode左侧的扩展页面，搜索",[32,2239,2240],{},"GitHub Pull Requests","，安装由Github发布的",[32,2243,2240],{},"扩展。",[74,2246,2247],{},[77,2248],{"alt":30,"src":2249},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787066639021-9a02afab.webp",[15,2251,2252],{"start":52},[18,2253,2254],{},"从main创建功能分支",[74,2256,2257,2258,2261],{},"先点击VScode左下角的当前分支名，切换到main分支。在源代码管理页面点击选择",[32,2259,2260],{},"Pull","，保证本地main分支与Github上的内容一致。",[74,2263,2264],{},[77,2265],{"alt":30,"src":2266},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067349047-4d94b8b8.webp",[74,2268,2269],{},[77,2270],{"alt":30,"src":2271},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067390159-f719aeea.webp",[74,2273,2274,2275,2278,2279,2281],{},"再次点击左下角的分支名，选择",[32,2276,2277],{},"Create new branch from...","，选择main作为起点，然后输入一个能表达修改内容的分支名，例如",[32,2280,1470],{},"。创建后VScode会自动切换到该分支。",[74,2283,2284],{},[77,2285],{"alt":30,"src":2266},[74,2287,2288],{},[77,2289],{"alt":30,"src":2290},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067431992-eade67a5.webp",[74,2292,2293],{},[77,2294],{"alt":30,"src":2295},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067511583-3a757fd7.webp",[74,2297,2298],{},[77,2299],{"alt":30,"src":2300},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067526052-f9bbf20b.webp",[74,2302,2303],{},[77,2304],{"alt":30,"src":2305},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067546196-fb5d9180.webp",[15,2307,2308],{},[18,2309,2310],{},"修改文件并提交",[74,2312,2313],{},"在功能分支中修改文件并保存，然后打开源代码管理页面：",[74,2315,2316],{},[77,2317],{"alt":30,"src":2318},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067588271-e1b9561b.webp",[1613,2320,2321],{},[18,2322,2323,2324,2327],{},"点击文件右侧的",[32,2325,2326],{},"+","，将修改加入暂存区。",[1613,2329,2330],{},[18,2331,2332,2333,1579],{},"在上方输入提交信息，例如",[32,2334,2335],{},"Add PR demo",[1613,2337,2338],{},[18,2339,1739,2340,2343],{},[32,2341,2342],{},"Commit","完成本地提交。",[74,2345,2346],{},[77,2347],{"alt":30,"src":2348},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067621148-3174d0c2.webp",[74,2350,2351],{},[77,2352],{"alt":30,"src":2353},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067634417-f8d1f64e.webp",[74,2355,2356],{},"commit后变为",[74,2358,2359],{},[77,2360],{"alt":30,"src":2361},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067649357-58274e7e.webp",[15,2363,2364],{},[18,2365,2366],{},"在VScode中创建PR",[74,2368,2369,2370,2373,2374,2377,2378,1579],{},"打开左侧的Github Pull Requests页面，点击",[32,2371,2372],{},"Create Pull Request","。也可以按",[32,2375,2376],{},"Ctrl+Shift+P","打开命令面板，执行",[32,2379,2380],{},"GitHub Pull Requests: Create Pull Request",[74,2382,2383],{},[77,2384],{"alt":30,"src":2385},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067711915-86c8f341.webp",[15,2387,2388],{"start":52},[18,2389,2390],{},"填写PR信息",[74,2392,2393],{},"在Create Pull Request页面中检查以下内容：",[1613,2395,2396],{},[18,2397,2398,2401],{},[32,2399,2400],{},"Base Repository","：接收修改的Github仓库。",[1613,2403,2404],{},[18,2405,2406,2409],{},[32,2407,2408],{},"Base Branch","：要合并进入的目标分支，通常为main。",[1613,2411,2412],{},[18,2413,2414,2415,1579],{},"来源分支：当前的功能分支，例如",[32,2416,1470],{},[1613,2418,2419],{},[18,2420,2421,2424],{},[32,2422,2423],{},"Title","：简洁描述本次修改。",[1613,2426,2427],{},[18,2428,2429,2432],{},[32,2430,2431],{},"Description","：说明修改原因、主要内容和验证方法。",[74,2434,2435,2436,2439,2440,2443],{},"也可以根据需要添加Reviewers、Assignees和Labels。检查无误后点击",[32,2437,2438],{},"Create","提交PR；如果修改还没有完成，可以选择",[32,2441,2442],{},"Create Draft","创建草稿PR。",[74,2445,2446],{},[77,2447],{"alt":30,"src":2448},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067744001-1402f27c.webp",[74,2450,2451,2452,2455],{},"如果当前分支还没有推送到Github，VScode会提示发布分支。选择",[32,2453,2454],{},"publish branch","即可将当前功能分支推送到远程仓库。",[74,2457,2458],{},[77,2459],{"alt":30,"src":2460},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067764516-85017976.webp",[15,2462,2463],{},[18,2464,2465],{},"审查并修改PR",[74,2467,2468],{},"创建成功后，VScode会进入PR的Review Mode。在这里可以查看提交记录和文件差异、留言、邀请审查，也可以继续修改代码。",[74,2470,2471],{},"可以查看合并差异:",[74,2473,2474],{},[77,2475],{"alt":30,"src":2476},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067924816-f471716b.webp",[74,2478,2479],{},[77,2480],{"alt":30,"src":2481},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067950428-546ebd4d.webp",[74,2483,2484],{},"如果需要根据审查意见修改代码，保持在当前功能分支上，然后继续使用源代码管理页面进行Commit.也就是可以继续修改.",[74,2486,2487],{},[77,2488],{"alt":30,"src":2489},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787067992272-a06147b4.webp",[74,2491,2492,2493,453],{},"同样先add再commit本次修改,可以命名为",[32,2494,2495],{},"Add PR demo2",[74,2497,2498],{},[77,2499],{"alt":30,"src":2500},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068021566-fb6e4d49.webp",[74,2502,2503],{},"最后Push。新的提交会自动加入当前PR，不需要重新创建PR。",[74,2505,2506],{},[77,2507],{"alt":30,"src":2508},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068141475-fe774f6d.webp",[74,2510,2511],{},"可以看到如图,两次commit都被PR包含了.",[74,2513,2514],{},[77,2515],{"alt":30,"src":2516},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068203009-6768f4a0.webp",[74,2518,2519],{},"也可以看到文件差异里,两次提交都被可以被合并到main了.",[74,2521,2522],{},[77,2523],{"alt":30,"src":2524},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068234996-9c2f6fa0.webp",[15,2526,2527],{},[18,2528,2529],{},"合并PR并清理分支",[74,2531,2532,2533,2536],{},"审查通过且自动检查完成后，拥有仓库写入权限的成员可以在PR详情页点击",[32,2534,2535],{},"Merge","完成合并。",[74,2538,2539],{},[77,2540],{"alt":30,"src":2541},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068282082-21f37f97.webp",[74,2543,2544],{},[77,2545],{"alt":30,"src":2546},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068295774-46294b05.webp",[74,2548,2549,2550,2552],{},"合并完成后，VScode会提示删除远程和本地的功能分支。确认PR已经正确合并后再进行删除，最后切换回main分支并点击",[32,2551,2260],{},"获取最新代码。",[74,2554,2555],{},[77,2556],{"alt":30,"src":2557},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068313339-dfe5dbc9.webp",[74,2559,2560],{},[77,2561],{"alt":30,"src":2562},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068345756-fd3adb23.webp",[74,2564,2565],{},"紧接着PR会被自动关闭.",[74,2567,2568],{},[77,2569],{"alt":30,"src":2570},"https:\u002F\u002Fcdn.tungchiahui.cn\u002Ftungwebsite\u002Fassets\u002Fimages\u002F2023\u002F12\u002F29\u002F1787068378293-1ef31793.webp",[2572,2573,2574],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":30,"searchDepth":52,"depth":52,"links":2576},[2577,2578,2579],{"id":12,"depth":65,"text":13},{"id":82,"depth":65,"text":83},{"id":1989,"depth":65,"text":1990},"\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao",0,"0200","2023-12-29","wiki\u002F2023-12-29-git-jiao-xue","en-us:2023-12-29-git-jiao-xue","\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue","Git教学","md","wiki\u002F2023-12-29-Git教学\u002F0200-Git实操",false,true,null,"en-US","en-us",{},{"title":5,"description":30},"\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao","_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002F0200-Git实操","d8L_CTuVJpDVAyanZ3PRFdSVBiFnVXxNCbhMNPFiJl4",[2601,2606,2607,2612,2617],{"path":2602,"stem":2603,"title":2604,"date":2583,"chapterOrder":2605,"chapterDepth":2581,"docKey":2585,"docRoot":2586,"docTitle":2587,"isWikiDoc":2591,"isWikiIndex":2590},"\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0100-git-jian-jie","_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002F0100-Git简介","Introduction to Git","0100",{"path":2580,"stem":2598,"title":5,"date":2583,"chapterOrder":2582,"chapterDepth":2581,"docKey":2585,"docRoot":2586,"docTitle":2587,"isWikiDoc":2591,"isWikiIndex":2590},{"path":2608,"stem":2609,"title":2610,"date":2583,"chapterOrder":2611,"chapterDepth":2581,"docKey":2585,"docRoot":2586,"docTitle":2587,"isWikiDoc":2591,"isWikiIndex":2590},"\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0300-gao-ji-gong-ju","_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002F0300-高级工具","Advanced Tools","0300",{"path":2613,"stem":2614,"title":2615,"date":2583,"chapterOrder":2616,"chapterDepth":2581,"docKey":2585,"docRoot":2586,"docTitle":2587,"isWikiDoc":2591,"isWikiIndex":2590},"\u002Fen-us\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0400-chang-jian-wen-ti","_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002F0400-常见问题","Frequently Asked Questions","0400",{"path":2586,"stem":2618,"title":2619,"date":2583,"chapterOrder":2592,"chapterDepth":2581,"docKey":2585,"docRoot":2586,"docTitle":2587,"isWikiDoc":2591,"isWikiIndex":2591},"_i18n\u002Fen-us\u002Fwiki\u002F2023-12-29-Git教学\u002Findex","Git tutorial",{"variants":2621},[2622,2623,2626,2629,2632],{"path":2580,"localeSlug":2594,"i18nKey":2589},{"path":2624,"localeSlug":2625,"i18nKey":2589},"\u002Fzh-hant\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao","zh-hant",{"path":2627,"localeSlug":2628,"i18nKey":2589},"\u002Fzh-hk\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao","zh-hk",{"path":2630,"localeSlug":2631,"i18nKey":2589},"\u002Fzh-tw\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao","zh-tw",{"path":2633,"localeSlug":2634,"i18nKey":2589},"\u002Fzh-cn\u002Fwiki\u002F2023-12-29-git-jiao-xue\u002F0200-git-shi-cao","zh-cn",[2580,2597,2624,2597,2627,2597,2630,2597,2633,2597],1788531343458]