<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Git - Tag - arleo.eu</title><link>https://www.arleo.eu/en/tags/git/</link><description>Git - Tag - arleo.eu</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 09 May 2026 13:03:25 +0200</lastBuildDate><atom:link href="https://www.arleo.eu/en/tags/git/" rel="self" type="application/rss+xml"/><item><title>Strategy 4: separating content (MCP) from structure (Git)</title><link>https://www.arleo.eu/en/posts/strategie-4-mcp-vs-git/</link><pubDate>Sat, 09 May 2026 13:03:25 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/strategie-4-mcp-vs-git/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/strategie-4-mcp-vs-git-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="the-problem">The problem</h2>
<p>You have a Hugo site. You want to:</p>
<ol>
<li><strong>Edit content via Claude.ai</strong> (publish an article, fix a typo, update a draft) without touching an SSH terminal.</li>
<li><strong>Version the structure</strong> (layouts, themes, hugo.toml, deploy scripts) in Git, like a serious dev.</li>
</ol>
<p>First instinct: &ldquo;everything in Git&rdquo;. Articles too. The MCP commits, pushes, GitHub webhook triggers a rebuild. Clean, GitOps-philosophy.</p>
<p>Except it doesn&rsquo;t work that well. Here&rsquo;s why, and the simple solution I call <strong>Strategy 4</strong>.</p>
<h2 id="why-everything-in-git-breaks-in-practice">Why &ldquo;everything in Git&rdquo; breaks in practice</h2>
<p>Imagine your MCP <code>git commit</code>s on every <code>create_page</code>. Naive strategy, often suggested. Here are the problems:</p>
<h3 id="problem-1--mcp--git-conflict">Problem 1 — MCP ↔ Git conflict</h3>
<p>You push a new layout from your laptop (<code>layouts/index.html</code> modified). At the same time, the MCP is committing a new article version. Race condition: the MCP might <code>git pull --rebase</code> and fail, or worse, overwrite your local commit.</p>
<h3 id="problem-2--mcps-git-identity">Problem 2 — MCP&rsquo;s Git identity</h3>
<p>Whose commits is the MCP making? With which GPG key? If you have a &ldquo;signed commits required&rdquo; policy, the MCP needs to manage a GPG key, which has to be secured, rotated, etc.</p>
<h3 id="problem-3--unwanted-auto-commits">Problem 3 — Unwanted auto-commits</h3>
<p>You&rsquo;re testing, you create a draft article to experiment, you delete it. But the MCP already committed. Now you have a &ldquo;wip test&rdquo; commit in history, to rebase or squash manually.</p>
<h3 id="problem-4--asymmetric-reversibility">Problem 4 — Asymmetric reversibility</h3>
<p>A <code>git revert</code> repo-side has no effect on files the MCP already created. You end up with a desynchronized repo and filesystem state.</p>
<h2 id="strategy-4-separate-the-zones">Strategy 4: separate the zones</h2>
<p>The idea: <strong>MCP and Git never write to the same files</strong>.</p>
<table>
  <thead>
      <tr>
          <th>Zone</th>
          <th>Who edits</th>
          <th>Versioned in Git?</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>content/**/*.md</code></td>
          <td><strong>MCP only</strong></td>
          <td>❌ NO (<code>.gitignore</code>)</td>
      </tr>
      <tr>
          <td><code>layouts/</code>, <code>themes/</code>, <code>static/</code>, <code>hugo.toml</code>, <code>deploy.sh</code></td>
          <td><strong>Git push only</strong></td>
          <td>✅ YES</td>
      </tr>
  </tbody>
</table>
<p>Repo-side <code>.gitignore</code>:</p>
<div class="code-block code-line-numbers open" data-start="0">
    <div class="code-header language-">
        <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="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><pre tabindex="0"><code>content/
public/
resources/</code></pre></div>
<p>Implications:</p>
<ul>
<li>The MCP can write to <code>content/</code> whenever. No Git conflict possible.</li>
<li>You can <code>git reset --hard</code> repo-side with confidence — <code>content/</code> stays intact.</li>
<li>No need for the MCP to manage a Git identity.</li>
<li>No &ldquo;commit pollution&rdquo;.</li>
</ul>
<h2 id="trade-off-no-content-versioning">Trade-off: no content versioning</h2>
<p>You lose Git versioning of content. That&rsquo;s a real loss:</p>
<ul>
<li>No <code>git blame</code> on an article to see who wrote what.</li>
<li>No <code>git log content/csp-nonce/index.fr.md</code> for history.</li>
<li>No PR review for articles.</li>
</ul>
<p><strong>Mitigation</strong>: VM snapshots + daily encrypted <code>content/</code> backup to QNAP. That covers <strong>disaster recovery</strong>, but not fine-grained versioning (who-changed-what-when).</p>
<p>For my personal homelab (single author, technical articles, no editorial validation workflow), it&rsquo;s an acceptable trade-off. For a 10-contributor team blog, I&rsquo;d reconsider.</p>
<h2 id="final-architecture">Final architecture</h2>]]></description></item></channel></rss>