<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>技术 - 分类 - Vindrin</title><link>https://vindrin.top/zh-cn/categories/%E6%8A%80%E6%9C%AF/</link><description>技术 - 分类 - Vindrin</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>vindrin@outlook.com (Vindrin)</managingEditor><webMaster>vindrin@outlook.com (Vindrin)</webMaster><lastBuildDate>Tue, 10 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://vindrin.top/zh-cn/categories/%E6%8A%80%E6%9C%AF/" rel="self" type="application/rss+xml"/><item><title>搞懂 Git Rebase 和 Merge 的区别</title><link>https://vindrin.top/zh-cn/posts/git-rebase-vs-merge/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/zh-cn/posts/git-rebase-vs-merge/</guid><description><![CDATA[<h1 id="搞懂-git-rebase-和-merge-的区别">搞懂 Git Rebase 和 Merge 的区别</h1>
<p>这个问题几乎困扰过每一个开发者，今天来讲清楚。</p>
<h2 id="merge">Merge</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git checkout main
</span></span><span class="line"><span class="cl">git merge feature-branch</span></span></code></pre></div></div>
<p>会创建一个<strong>合并提交</strong>。历史记录清晰展示了两条分支在某个节点汇合。适合共享分支。</p>
<h2 id="rebase">Rebase</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git checkout feature-branch
</span></span><span class="line"><span class="cl">git rebase main</span></span></code></pre></div></div>
<p>将你的提交&quot;移植&quot;到 <code>main</code> 最新节点之后。历史记录看起来是<strong>线性的</strong>，就像你是在 main 更新后才开始做功能一样。</p>
<h2 id="什么时候用哪个">什么时候用哪个？</h2>
<table>
  <thead>
      <tr>
          <th>场景</th>
          <th>推荐方式</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>共享分支（main、dev）</td>
          <td><code>merge</code></td>
      </tr>
      <tr>
          <td>个人功能分支</td>
          <td><code>rebase</code></td>
      </tr>
      <tr>
          <td>提 PR 之前整理提交</td>
          <td><code>rebase</code></td>
      </tr>
      <tr>
          <td>PR 合并后</td>
          <td>无所谓</td>
      </tr>
  </tbody>
</table>
<h2 id="黄金原则">黄金原则</h2>
<p><strong>永远不要对别人正在用的分支做 rebase。</strong> 重写共享历史会把所有人搞乱。</p>]]></description></item><item><title>Python 虚拟环境详解</title><link>https://vindrin.top/zh-cn/posts/python-venv-guide/</link><pubDate>Tue, 03 Feb 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/zh-cn/posts/python-venv-guide/</guid><description><![CDATA[<h1 id="python-虚拟环境详解">Python 虚拟环境详解</h1>
<p>如果你曾经因为全局升级某个包把项目搞崩了，那你就需要虚拟环境了。</p>
<h2 id="什么是虚拟环境">什么是虚拟环境？</h2>
<p>虚拟环境是一个隔离的 Python 安装——它有自己独立的 <code>pip</code> 和包，完全和系统 Python 分开。</p>
<h2 id="创建虚拟环境">创建虚拟环境</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">python -m venv .venv
</span></span><span class="line"><span class="cl"><span class="nb">source</span> .venv/bin/activate    <span class="c1"># Linux/macOS</span>
</span></span><span class="line"><span class="cl">.venv<span class="se">\S</span>cripts<span class="se">\a</span>ctivate       <span class="c1"># Windows</span></span></span></code></pre></div></div>
<h2 id="安装包">安装包</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install requests numpy pandas
</span></span><span class="line"><span class="cl">pip freeze &gt; requirements.txt</span></span></code></pre></div></div>
<h2 id="在别处恢复">在别处恢复</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">python -m venv .venv
</span></span><span class="line"><span class="cl">pip install -r requirements.txt</span></span></code></pre></div></div>
<h2 id="配合-conda-使用">配合 conda 使用</h2>
<p>如果你用 conda，<code>conda create -n myenv python=3.11</code> 也是同样的隔离效果。</p>]]></description></item><item><title>用 Hugo + LoveIt 搭建个人网站</title><link>https://vindrin.top/zh-cn/posts/hugo-setup-guide/</link><pubDate>Thu, 15 Jan 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/zh-cn/posts/hugo-setup-guide/</guid><description><![CDATA[<h1 id="用-hugo--loveit-搭建个人网站">用 Hugo + LoveIt 搭建个人网站</h1>
<p>Hugo 构建速度极快，LoveIt 主题简洁好看，两者组合是个人网站的绝佳选择。</p>
<h2 id="环境要求">环境要求</h2>
<ul>
<li>Hugo Extended v0.110+</li>
<li>Git</li>
</ul>
<h2 id="安装步骤">安装步骤</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Windows 安装 Hugo（通过 WinGet）</span>
</span></span><span class="line"><span class="cl">winget install Hugo.Hugo.Extended
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 新建站点</span>
</span></span><span class="line"><span class="cl">hugo new site my-blog
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> my-blog
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 将 LoveIt 作为 submodule 引入</span>
</span></span><span class="line"><span class="cl">git init
</span></span><span class="line"><span class="cl">git submodule add https://github.com/dillonzq/LoveIt themes/LoveIt</span></span></code></pre></div></div>
<h2 id="基础配置">基础配置</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-toml">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">baseURL</span> <span class="p">=</span> <span class="s2">&#34;https://yourdomain.com/&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">theme</span> <span class="p">=</span> <span class="s2">&#34;LoveIt&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">paginate</span> <span class="p">=</span> <span class="mi">5</span></span></span></code></pre></div></div>
<h2 id="启动服务器">启动服务器</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">hugo server -D</span></span></code></pre></div></div>
<p>打开 <code>http://localhost:1313</code> 就能看到效果了。</p>]]></description></item></channel></rss>