【版本控制】Git 和 GitHub 入门教程 - 指南
<style>pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; line-height: 1.6 !important; padding: 16px !important; margin: 16px 0 !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; tab-size: 4 !important; -moz-tab-size: 4 !important; max-width: 100% !important; box-sizing: border-box !important }code { font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; overflow-wrap: normal !important; display: inline !important; background: rgba(0, 0, 0, 0) !important; border: none !important; padding: 0 !important; margin: 0 !important; line-height: inherit !important }
pre code { background: rgba(0, 0, 0, 0) !important; border: 0 !important; border-radius: 0 !important; display: block !important; line-height: 1.6 !important; margin: 0 !important; max-width: none !important; overflow: visible !important; padding: 0 !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; color: inherit !important }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: rgba(112, 128, 144, 1) !important; font-style: italic !important }
.token.punctuation { color: rgba(153, 153, 153, 1) !important }
.token.atrule, .token.attr-value, .token.keyword { color: rgba(0, 119, 170, 1) !important; font-weight: bold !important }
.token.function, .token.class-name { color: rgba(221, 74, 104, 1) !important; font-weight: bold !important }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: rgba(102, 153, 0, 1) !important }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: rgba(153, 0, 85, 1) !important }
.cnblogs-markdown pre, .cnblogs-post-body pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; padding: 16px !important; margin: 16px 0 !important }
pre, pre, pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important }</style>
<style>pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; line-height: 1.6 !important; padding: 16px !important; margin: 16px 0 !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; tab-size: 4 !important; -moz-tab-size: 4 !important; max-width: 100% !important; box-sizing: border-box !important }
code { font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; overflow-wrap: normal !important; display: inline !important; background: rgba(0, 0, 0, 0) !important; border: none !important; padding: 0 !important; margin: 0 !important; line-height: inherit !important }
p code, li code, td code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { background-color: rgba(27, 31, 35, 0.05) !important; border-radius: 3px !important; font-size: 85% !important; margin: 0 !important; padding: 0.2em 0.4em !important; white-space: nowrap !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important }
pre code { background: rgba(0, 0, 0, 0) !important; border: 0 !important; border-radius: 0 !important; display: block !important; line-height: 1.6 !important; margin: 0 !important; max-width: none !important; overflow: visible !important; padding: 0 !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; color: inherit !important }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: rgba(112, 128, 144, 1) !important; font-style: italic !important }
.token.punctuation { color: rgba(153, 153, 153, 1) !important }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: rgba(153, 0, 85, 1) !important }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: rgba(102, 153, 0, 1) !important }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: rgba(154, 110, 58, 1) !important }
.token.atrule, .token.attr-value, .token.keyword { color: rgba(0, 119, 170, 1) !important; font-weight: bold !important }
.token.function, .token.class-name { color: rgba(221, 74, 104, 1) !important; font-weight: bold !important }
.token.regex, .token.important, .token.variable { color: rgba(238, 153, 0, 1) !important }
.language-javascript .token.keyword { color: rgba(0, 0, 255, 1) !important; font-weight: bold !important }
.language-javascript .token.string { color: rgba(0, 128, 0, 1) !important }
.language-javascript .token.number { color: rgba(0, 102, 204, 1) !important }
.language-javascript .token.operator { color: rgba(102, 102, 102, 1) !important }
.language-javascript .token.function { color: rgba(121, 85, 72, 1) !important; font-weight: bold !important }
.language-javascript .token.class-name { color: rgba(46, 125, 50, 1) !important; font-weight: bold !important }
.language-bash .token.function { color: rgba(0, 102, 204, 1) !important }
.language-bash .token.string { color: rgba(0, 128, 0, 1) !important }
.language-bash .token.keyword { color: rgba(0, 0, 255, 1) !important; font-weight: bold !important }
.token { display: inline !important; white-space: inherit !important }
.pre-numbering, .hljs-button, .opt-box, .hide-preCode-box { display: none !important }
.markdown_views pre, #content_views pre, .htmledit_views pre, .prettyprint, .hljs { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important }
.language-javascript, .language-java, .language-python, .language-bash, .language-css, .language-html { white-space: pre !important; word-wrap: normal !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important }
.cnblogs-markdown pre, .cnblogs-post-body pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; padding: 16px !important; margin: 16px 0 !important }
pre, pre, pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important }
pre, pre * { box-sizing: border-box !important }
@media (max-width: 768px) { pre { font-size: 12px !important; padding: 12px !important; overflow-x: auto !important } }</style><div id="content_views" class="markdown_views prism-atom-one-light"><svg xmlns="http://www.w3.org/2000/svg" style="display: none"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0)"></path></svg><p></p><div class="toc"><h4>目录</h4><ul><li>0 引言</li><li>1 Git与GitHub的诞生</li><li><ul><li>1.1 Git:Linus的“两周奇迹”,拯救Linux内核</li><li>1.2 GitHub:为Git插上协作的翅膀</li><li>1.3 协同进化:从工具到生态的质变</li><li>1.4 关键历程时间轴(2005–2008)</li></ul></li><li>2 Git与GitHub入门指南</li><li><ul><li>2.1 Git 入门:掌握代码的"时间机器"</li><li>2.2 GitHub 入门:开启云端协作之门</li><li>2.3 实战演练:第一次协作全流程</li><li>2.4 关键记忆卡</li></ul></li><li>3 同类产品</li><li><ul><li>3.1 与 Git 类似的版本控制工具</li><li>3.2 与 GitHub 类似的代码托管平台(替代 GitHub)</li><li>3.3 选择建议</li><li><ul><li>️ **版本控制与开发工具**</li></ul></li></ul></li></ul></div><p></p><p><img src="https://img-blog.csdnimg.cn/375e98bb5f234607a3a0ba46513175e1.gif#pic_center" alt="请添加图片描述" width="360"></p><blockquote><ul><li><strong>♂️ 作者:海码007</strong></li><li><strong> 专栏:C++专栏</strong></li><li><strong> 标题:【版本控制】Git 和 GitHub 入门教程</strong></li><li><strong>❣️ 寄语:人生的意义或许可以发挥自己全部的潜力,所以加油吧!</strong></li><li><strong> 最后:<em>文章作者技术和水平有限,如果文中出现错误,希望大家能指正</em></strong></li></ul></blockquote><h2>0 引言</h2><p>参考文章:廖雪峰 Git 教程</p><h2>1 Git与GitHub的诞生</h2><p>在如今的软件开发领域,Git与GitHub几乎已成为程序员呼吸的空气般自然的存在。但回溯它们的起源,你会发现这两者的诞生并非偶然,而是分别为了解决开发协作中两个关键层面的痛点。让我们回到历史现场,看看它们如何从零起步,重塑了代码世界的协作规则。</p><h3>1.1 Git:Linus的“两周奇迹”,拯救Linux内核</h3><p>2005年,Linux内核开发社区陷入一场突如其来的危机——他们原本依赖的<strong>商业版本控制系统BitKeeper</strong>,因版权争议被开发商BitMover收回了免费使用权。当时Linux内核已极其庞大,靠手工合并来自全球开发者的代码补丁,效率低下到几乎无法推进。而传统集中式工具如SVN、CVS,又因<strong>速度慢、必须联网、不符合开源精神</strong>被Linus Torvalds强烈排斥。</p><p><strong>被逼到墙角后,Linus做了一个震惊世界的决定:他自己写一个!</strong><br> 他用两周时间,用C语言开发出了一套全新的<strong>分布式版本控制系统(DVCS)</strong>——这就是Git。它直指三大核心痛点:</p><ol><li><strong>分布式架构</strong>:每个开发者本地拥有完整仓库,支持离线提交、查看历史,不再依赖中央服务器;</li><li><strong>高效分支管理</strong>:轻量级分支让多人并行开发成为可能,解决了“多版本维护”的地狱;</li><li><strong>数据强一致性</strong>:通过SHA-1哈希值确保每一次提交的完整性,防止代码篡改或丢失。</li></ol><p>短短一个月后,Linux内核代码已全面迁移至Git管理。这不仅解了燃眉之急,更无意中催生了未来十年最主流的版本控制工具。</p><hr><h3>1.2 GitHub:为Git插上协作的翅膀</h3><p>Git虽强,但它在2008年之前仍面临一个关键瓶颈:<strong>缺乏高效、易用的协作平台</strong>。开发者需自建服务器托管仓库,操作复杂,且缺少代码审查、任务管理等团队工具。更关键的是,开源项目难以被广泛发现和参与。</p><p>2008年4月,Tom Preston-Werner等人推出GitHub,目标很明确:<strong>让Git的分布式能力“云化”并社交化</strong>。它重点解决了Git本身不擅长的四大问题:</p><ol><li><strong>中心化托管与访问控制</strong>:提供云仓库托管,支持公/私有库,并引入用户权限管理,避免Git原生缺乏的安全问题;</li><li><strong>协作流程革命</strong>:创新性提出 <strong>Fork & Pull Request 机制</strong>——开发者可一键分叉项目→修改→发起PR→代码审查→合并,极大降低开源贡献门槛;</li><li><strong>项目管理集成</strong>:内置Issue跟踪、Wiki文档、里程碑管理,将代码与开发流程无缝绑定;</li><li><strong>开发者社交生态</strong>:引入Star、Follower、Trending榜单等机制,打造“代码社交网络”,让优秀项目不再埋没。</li></ol><p>GitHub迅速吸引超过4000万开发者,托管了包括Python、jQuery等几乎所有主流开源项目,成为事实上的“开源宇宙中心”。</p><hr><h3>1.3 协同进化:从工具到生态的质变</h3><p>Git与GitHub的关系,本质是<strong>引擎与平台</strong>的共生:</p><ul><li>Git是<strong>本地版本控制的基石</strong>,专注高效、可靠、离线可用的代码管理;</li><li>GitHub则是<strong>云端协作的枢纽</strong>,将Git的能力扩展为全球化、社交化、自动化的开发流。</li></ul><p>这种组合彻底改变了软件开发:</p><blockquote><p> 举个例子:一个学生Fork了某AI框架(GitHub),在本地修Bug并提交(Git),再发起PR被官方合并(GitHub协作流)——整个过程无需服务器配置,却实现了全球协作。</p></blockquote><hr><h3>1.4 关键历程时间轴(2005–2008)</h3>
<pre data-index="0" class="set-code-show prettyprint" style="white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important"><code class="prism language-plaintext has-numbering" style="position: unset">2005年7月 │ Linus怒写Git,拯救Linux内核于BitKeeper断供危机
2008年4月 │ GitHub上线,首创Fork+PR模型,代码社交时代开启
2018年6月 │ 微软75亿美元收购GitHub,加速整合DevOps与AI生态</code></pre>
<p>这场始于“自救”的技术革命,最终将代码协作从封闭的小作坊,推向了开放、互联、自动化的大生产时代。而今天你我指尖每一次<code>git commit</code>与<code>Merge PR</code>的动作,仍在延续这场始于2005年的进化之路 。</p><h2>2 Git与GitHub入门指南</h2><p>掌握Git与GitHub就像获得程序员的"时空操纵术"——既能自由穿梭代码历史,又能实现全球协作。下面用最直观的方式带你上手这两个改变开发工作流的革命性工具。</p><hr><h3>2.1 Git 入门:掌握代码的"时间机器"</h3><p><strong>核心概念三分钟速懂</strong></p><div class="table-box"><table><thead><tr><th>术语</th><th>作用</th><th>类比解释</th></tr></thead><tbody><tr><td><strong>仓库(Repository)</strong></td><td>存储代码历史记录的空间</td><td>项目的"时光档案馆"</td></tr><tr><td><strong>提交(Commit)</strong></td><td>保存代码快照的操作</td><td>给当前代码拍一张"历史照片"</td></tr><tr><td><strong>分支(Branch)</strong></td><td>独立开发线</td><td>平行宇宙中的实验空间</td></tr><tr><td><strong>暂存区(Staging)</strong></td><td>准备提交的临时区域</td><td>快递打包区(选中的才发货)</td></tr></tbody></table></div><p><strong>新手必会五连招</strong></p>
<pre data-index="1" class="set-code-hide prettyprint" style="white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important"><code class="prism language-bash has-numbering" style="position: unset"><span class="token comment"># 1. 创建新仓库(初始化时光机)</span>
<span class="token function">git</span> init
<span class="token comment"># 2. 添加文件到暂存区(选择要存档的文件)</span>
<span class="token function">git</span> <span class="token function">add</span> index.html <span class="token comment"># 添加单个文件</span>
<span class="token function">git</span> <span class="token function">add</span> <span class="token builtin class-name">.</span> <span class="token comment"># 添加所有修改</span>
<span class="token comment"># 3. 提交快照(拍下历史照片)</span>
<span class="token function">git</span> commit <span class="token parameter variable">-m</span> <span class="token string">"创建登录页面"</span>
<span class="token comment"># 4. 创建安全实验空间(开创新分支)</span>
<span class="token function">git</span> checkout <span class="token parameter variable">-b</span> feature-login
<span class="token comment"># 5. 合并分支(将实验成果并入主宇宙)</span>
<span class="token function">git</span> checkout main
<span class="token function">git</span> merge feature-login</code></pre>
<p><strong>避坑指南</strong></p><ul><li><code>git status</code>:随时查看当前状态(避免迷路)</li><li><code>git log --oneline</code>:查看简洁历史记录(时光机导航)</li><li><code>git reset --hard HEAD~1</code>:回退到上一个提交(时光倒流)</li></ul><hr><h3>2.2 GitHub 入门:开启云端协作之门</h3><p><strong>四步构建你的代码星球</strong></p><ol><li><p><strong>创建仓库</strong></p><p><img src="https://i-blog.csdnimg.cn/direct/141d8d2b796c4d0e9085668c08c9882c.png#pic_center" alt="在这里插入图片描述" width="660"></p></li></ol><p><img src="https://i-blog.csdnimg.cn/direct/9dfc3e2b67214bff8b71877a192355dc.png#pic_center" alt="在这里插入图片描述" width="660"></p><ol start="2"><li><p><strong>连接本地与云端</strong><br><img src="https://i-blog.csdnimg.cn/direct/e4e439be6f58430abc3159ee40115b8c.png#pic_center" alt="在这里插入图片描述" width="660"></p> <pre data-index="2" class="set-code-show prettyprint" style="white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important"><code class="prism language-bash has-numbering" style="position: unset"><span class="token comment"># 复制仓库SSH/HTTPS链接</span>
<span class="token function">git</span> remote <span class="token function">add</span> origin https://github.com/你的账号/项目名.git
<span class="token function">git</span> push <span class="token parameter variable">-u</span> origin main <span class="token comment"># 首次推送建立关联</span></code></pre> </li><li><p><strong>每日同步代码</strong></p> <pre data-index="3" class="set-code-show prettyprint" style="white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important"><code class="prism language-bash has-numbering" style="position: unset"><span class="token function">git</span> pull <span class="token comment"># 早:拉取云端最新代码</span>
<span class="token function">git</span> push <span class="token comment"># 晚:推送本地修改</span></code></pre> </li><li><p><strong>协作金钥匙:Pull Request</strong><br> Fork他人仓库 → 2. 本地修改 → 3. 发起PR → 4. 等待审核合并</p></li></ol><p><strong>GitHub必备功能</strong></p><ul><li><strong>Issues</strong>:任务管理器(Bug追踪/需求收集)</li><li><strong>Wiki</strong>:项目知识库(文档沉淀)</li><li><strong>Actions</strong>:自动化流水线(测试/部署)</li><li><strong>Insights</strong>:数据分析中心(贡献者/代码活跃度)</li></ul><hr><h3>2.3 实战演练:第一次协作全流程</h3><p>假设你要给开源项目<code>awesome-project</code>添加文档:</p><div class="mermaid"><svg id="mermaid-svg-pQG6kd24gMn3i38D" width="100%" xmlns="http://www.w3.org/2000/svg" height="587" style="max-width: 1509px" viewBox="-50 -10 1509 587" class="mermaid-svg"><g></g><defs><symbol id="computer" width="24" height="24"><path transform="scale(.5)" d="M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"></path></symbol></defs><defs><symbol id="database" fill-rule="evenodd"><path transform="scale(.5)" d="M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"></path></symbol></defs><defs><symbol id="clock" width="24" height="24"><path transform="scale(.5)" d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"></path></symbol></defs><g><line id="actor7" x1="75" y1="5" x2="75" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-7"><rect x="0" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="75" dy="0">
You
</tspan></text></g></g><g><line id="actor8" x1="334" y1="5" x2="334" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-8"><rect x="259" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="334" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="334" dy="0">
GitHub
</tspan></text></g></g><g><line id="actor9" x1="534" y1="5" x2="534" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-9"><rect x="459" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="534" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="534" dy="0">
Local
</tspan></text></g></g><g><line id="actor10" x1="734" y1="5" x2="734" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-10"><rect x="659" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="734" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="734" dy="0">
VSCode
</tspan></text></g></g><g><line id="actor11" x1="934" y1="5" x2="934" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-11"><rect x="859" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="934" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="934" dy="0">
Git
</tspan></text></g></g><g><line id="actor12" x1="1134" y1="5" x2="1134" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-12"><rect x="1059" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1134" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="1134" dy="0">
ProjectOwner
</tspan></text></g></g><g><line id="actor13" x1="1334" y1="5" x2="1334" y2="521" class="200" stroke-width="0.5px" stroke="#999"></line><g id="root-13"><rect x="1259" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1334" y="32.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="1334" dy="0">
PR
</tspan></text></g></g><defs><marker id="arrowhead" refX="9" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z"></path></marker></defs><defs><marker id="crosshead" markerWidth="15" markerHeight="8" orient="auto" refX="16" refY="4"><path fill="black" stroke="#000000" style="" stroke-width="1px" d="M 9,2 V 6 L16,4 Z"></path><path fill="none" stroke="#000000" style="" stroke-width="1px" d="M 0,1 L 6,7 M 6,1 L 0,7"></path></marker></defs><defs><marker id="filled-head" refX="18" refY="7" markerWidth="20" markerHeight="28" orient="auto"><path d="M 18,7 L9,13 L14,7 L9,1 Z"></path></marker></defs><defs><marker id="sequencenumber" refX="15" refY="15" markerWidth="60" markerHeight="40" orient="auto"><circle cx="15" cy="15" r="6"></circle></marker></defs><text x="205" y="80" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
1. Fork awesome-project
</text><line x1="75" y1="117" x2="334" y2="117" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="305" y="132" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
2. git clone 你的Fork仓库
</text><line x1="75" y1="169" x2="534" y2="169" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="405" y="184" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
3. 编辑docs.md文件
</text><line x1="75" y1="221" x2="734" y2="221" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="505" y="236" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
4. git add & commit & push
</text><line x1="75" y1="273" x2="934" y2="273" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="205" y="288" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
5. 点击New Pull Request
</text><line x1="75" y1="325" x2="334" y2="325" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="1234" y="340" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
6. 代码审查+评论
</text><line x1="1134" y1="377" x2="1334" y2="377" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="705" y="392" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
7. 根据反馈修改
</text><line x1="75" y1="429" x2="1334" y2="429" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><text x="734" y="444" text-anchor="middle" dominant-baseline="middle" alignment-baseline="middle" style="font-family: "trebuchet ms", verdana, arial, sans-serif; font-weight: 400" class="messageText" dy="1em">
8. Merge合并!
</text><line x1="1134" y1="481" x2="334" y2="481" class="messageLine0" stroke-width="2" stroke="none" style="fill: none" marker-end="url(#arrowhead)"></line><g><rect x="0" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="75" dy="0">
You
</tspan></text></g><g><rect x="259" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="334" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="334" dy="0">
GitHub
</tspan></text></g><g><rect x="459" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="534" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="534" dy="0">
Local
</tspan></text></g><g><rect x="659" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="734" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="734" dy="0">
VSCode
</tspan></text></g><g><rect x="859" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="934" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="934" dy="0">
Git
</tspan></text></g><g><rect x="1059" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1134" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="1134" dy="0">
ProjectOwner
</tspan></text></g><g><rect x="1259" y="501" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1334" y="533.5" style="text-anchor: middle; font-weight: 400; font-family: "Open-Sans", "sans-serif"" dominant-baseline="central" alignment-baseline="central" class="actor"><tspan x="1334" dy="0">
PR
</tspan></text></g></svg></div><blockquote><p> <strong>Tips</strong>:首次使用建议开启Git的图形化工具</p><ul><li>VS Code内置Git支持</li><li>GitHub Desktop(官方可视化工具)</li><li>GitKraken(专业级跨平台客户端)</li></ul></blockquote><hr><h3>2.4 关键记忆卡</h3><div class="table-box"><table><thead><tr><th>场景</th><th>Git命令</th><th>GitHub操作</th></tr></thead><tbody><tr><td>开始新项目</td><td><code>git init</code></td><td>Create Repository</td></tr><tr><td>保存进度</td><td><code>git commit -m "..."</code></td><td>-</td></tr><tr><td>上传代码</td><td><code>git push</code></td><td>自动同步到云端</td></tr><tr><td>获取他人代码</td><td><code>git pull</code></td><td>Watch/Fork仓库</td></tr><tr><td>贡献开源项目</td><td>-</td><td>Fork + Pull Request</td></tr></tbody></table></div><hr><p>掌握这些基础操作,你已经能应对90%的日常开发场景!Git如同个人时间管理器,GitHub则是团队协作的中央枢纽,两者结合就像获得了"代码宇宙的通行证"。</p><p>以下是关于与 <strong>Git 工具类似</strong>的版本控制系统,以及与 <strong>GitHub 平台类似</strong>的代码托管服务的全面整理,结合技术特性和适用场景进行分类说明:</p><hr><h2>3 同类产品</h2><h3>3.1 与 Git 类似的版本控制工具</h3><p>此类工具主要用于代码的版本管理、分支控制、多人协作,分为 <strong>分布式</strong> 和 <strong>集中式</strong> 两类:</p><ol><li><strong>分布式版本控制系统</strong>(类似 Git 的架构)</li></ol><ul><li><strong>Mercurial (Hg)</strong>:语法简洁,学习曲线平缓,适合初学者;处理大型代码库性能优异(如 Mozilla 和 Python 项目使用)。</li><li><strong>Bazaar</strong>:强调灵活性与易用性,支持多种协作模型,适合小型团队或个人项目。</li><li><strong>Darcs</strong>:基于“补丁理论”的独特算法,简化分支合并操作,适合追求简洁工作流的团队。</li></ul><ol start="2"><li><strong>集中式版本控制系统</strong>(需连接中央服务器)</li></ol><ul><li><strong>SVN (Subversion)</strong>:经典集中式工具,适合需要频繁合并的场景(如企业传统项目)。</li><li><strong>Perforce</strong>:商业级工具,擅长管理大型二进制文件(如游戏开发),支持高并发和精细权限控制。</li><li><strong>TFVC (Team Foundation Version Control)</strong>:微软生态专用,深度集成 Azure DevOps,适合 .NET 技术栈团队。</li></ul><p><strong>⚖️ 分布式 vs 集中式工具对比:</strong></p><div class="table-box"><table><thead><tr><th><strong>特性</strong></th><th><strong>分布式(Git/Mercurial)</strong></th><th><strong>集中式(SVN/Perforce)</strong></th></tr></thead><tbody><tr><td><strong>架构</strong></td><td>本地完整仓库,支持离线操作</td><td>依赖中央服务器,需联网提交</td></tr><tr><td><strong>分支/合并成本</strong></td><td>轻量级,高效</td><td>较重,合并冲突处理复杂</td></tr><tr><td><strong>适用场景</strong></td><td>开源协作、频繁实验性开发</td><td>企业级流水线、大型二进制文件管理</td></tr></tbody></table></div><hr><h3>3.2 与 GitHub 类似的代码托管平台(替代 GitHub)</h3><p>此类平台提供 Git 仓库托管、协作工具、CI/CD 等完整 DevOps 能力,分为 <strong>公有云服务</strong> 和 <strong>自托管方案</strong>:</p><ol><li><strong>主流公有云平台</strong></li></ol><ul><li><strong>GitLab</strong>:最接近 GitHub 的替代品,提供无限免费私有库 + 内置 CI/CD,支持私有化部署。</li><li><strong>Bitbucket</strong>:免费支持 5 人小团队私有库,深度集成 Jira/Confluence,适合 Atlassian 生态用户。</li><li><strong>Gitee(码云)</strong>:国内主流平台,访问速度快,适合中文开源项目及合规性要求高的场景。</li><li><strong>Azure DevOps</strong>:微软全家桶成员,无缝衔接 Azure 云服务,适合企业级 CI/CD 流水线。</li></ul><ol start="2"><li><strong>轻量自托管方案</strong>(可私有化部署)</li></ol><ul><li><strong>Gitea / Gogs</strong>:Go 语言开发,资源占用低,部署简单,适合个人或小团队私有环境。</li><li><strong>GitBucket</strong>:Scala 实现的开源 GitHub 克隆,功能齐全,适合需要高度定制化的团队。</li><li><strong>Phabricator</strong>:集成代码审查、任务跟踪、Wiki,适合中大型团队协作。</li></ul><p><strong> 国内开发者常用平台:</strong></p><div class="table-box"><table><thead><tr><th><strong>平台</strong></th><th><strong>核心优势</strong></th><th><strong>适用场景</strong></th></tr></thead><tbody><tr><td>Gitee</td><td>政策合规、中文社区活跃</td><td>国内开源项目、企业级托管</td></tr><tr><td>CODING</td><td>腾讯生态集成、Web IDE 支持</td><td>教育机构、初创团队</td></tr><tr><td>Codeup(阿里云)</td><td>免费容量大、阿里云无缝集成</td><td>云原生项目、DevOps 自动化</td></tr></tbody></table></div><p><strong> 平台特性对比表:</strong></p><div class="table-box"><table><thead><tr><th><strong>平台</strong></th><th><strong>私有部署</strong></th><th><strong>免费私有库</strong></th><th><strong>CI/CD 内置</strong></th><th><strong>特色功能</strong></th></tr></thead><tbody><tr><td><strong>GitLab</strong></td><td>✅</td><td>✅</td><td>✅</td><td>完整 DevOps 流水线</td></tr><tr><td><strong>Bitbucket</strong></td><td>❌</td><td>✅(≤5人)</td><td>✅</td><td>Jira/Confluence 深度集成</td></tr><tr><td><strong>Gitea</strong></td><td>✅</td><td>✅</td><td>⚠️(需插件)</td><td>轻量级、低资源消耗</td></tr><tr><td><strong>SourceForge</strong></td><td>❌</td><td>✅</td><td>❌</td><td>老牌开源社区、多协议支持</td></tr></tbody></table></div><hr><h3>3.3 选择建议</h3><ul><li><strong>需要完全控制代码与数据</strong> → 自托管方案(<strong>GitLab CE</strong>、<strong>Gitea</strong>)。</li><li><strong>小团队低成本协作</strong> → <strong>Bitbucket</strong>(免费私有库)或 <strong>Gitee</strong>(国内网络优化)。</li><li><strong>企业级 DevOps 流水线</strong> → <strong>GitLab</strong> 或 <strong>Azure DevOps</strong>(深度云集成)。</li><li><strong>替代 GitHub 的开源生态</strong> → <strong>GitLab</strong> 或 <strong>SourceForge</strong>(老牌社区支持)。</li></ul><p>腾讯内部使用的工具链覆盖了开发、测试、协作、项目管理等全流程,结合自研系统与行业主流工具,形成了高效的技术生态。以下是核心工具分类及说明:</p><hr><h4>️ <strong>版本控制与开发工具</strong></h4><ol><li><p><strong>UGit(自研 Git 客户端)</strong></p><ul><li><strong>定位</strong>:专为大型项目(尤其是游戏开发)优化,解决原生 Git 在大文件管理、高频协作中的痛点。</li><li><strong>核心功能</strong>:
<ul><li><strong>大文件管理</strong>:内置 Git LFS 模板,支持 >4GB 文件无损传输及本地缓存加速。</li><li><strong>工蜂锁机制</strong>:针对二进制文件(如美术资源)设计文件/目录级锁,避免并行修改冲突。</li><li><strong>快速提交</strong>:无需强制更新即可提交未冲突文件,提升大型团队效率。</li><li><strong>子目录检出</strong>:仅克隆所需目录,加速大型仓库访问。</li></ul></li><li><strong>适用场景</strong>:游戏开发、多仓库管理、非技术角色(如策划)协作。</li></ul></li><li><p><strong>工蜂</strong><br> -工蜂 ≈ 腾讯版GitHub/GitLab</p></li></ol></div><br><br>
来源:https://www.cnblogs.com/ljbguanli/p/18929850
頁:
[1]