<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>loneryk的博客</title><description>loneryk的博客</description><link>https://loneryk.xyz/</link><templateTheme>Firefly</templateTheme><templateThemeVersion>V3.0.2</templateThemeVersion><templateThemeUrl>https://github.com/CuteLeaf/Firefly</templateThemeUrl><lastBuildDate>2026年10月21日 11:59:44</lastBuildDate><item><title>Github工作流</title><link>https://loneryk.xyz/posts/github%E5%B7%A5%E4%BD%9C%E6%B5%81/</link><guid isPermaLink="true">https://loneryk.xyz/posts/github%E5%B7%A5%E4%BD%9C%E6%B5%81/</guid><description>初接触git&amp;github协作</description><pubDate>Tue, 20 Oct 2026 00:00:00 GMT</pubDate><content:encoded><![CDATA[<p><strong>fork原仓库 &amp; clone 自己的fork</strong>  : 将main代码全部拉取到本地  再添加 upstream 远端仓库</p>
<pre><code class="language-bash">git clone 
cd 仓库
git remote add upstream 
</code></pre>
<p><strong>新建分支</strong> ： 根据实际工作需要创建分支，避免影响 main分支的正常功能。参照业务规范来进行分支的命名等细致要求</p>
<p><strong>修改代码</strong> </p>
<p><strong>提交代码</strong>： 使用命令 git add git commit 来提交你的代码 </p>
<p><strong>远程 main 分支是否发生改动</strong></p>
<p>否： git push 提交合并请求 如若本次合并有过多的commit 视情况进行Squash merge</p>
<p>是：为避免冲突 先切换回main分支 拉取远端upstream  即 将远端main分支同步到本地</p>
<p> 之后切换回自己的分支 将main分支的commit rebase到自己的分支 即 保留 main分支提交代码并添加自己的提交</p>
<p><strong>是否发生冲突</strong> </p>
<p>是 ： 通常需要手动融合代码 解决冲突再</p>
<pre><code class="language-bash">git add 文件
git rebase --continue 
</code></pre>
<p>否 ：git push </p>
<p>至此 一条pr 产出，等待审查合并,合并之后删除分支</p>
]]></content:encoded></item></channel></rss>