<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Github on D. Sébastien Taggart</title>
    <link>https://www.sebastientaggart.com/tags/github/</link>
    <description>Recent content in Github on D. Sébastien Taggart</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 04 Oct 2026 22:13:05 -0400</lastBuildDate>
    <atom:link href="https://www.sebastientaggart.com/tags/github/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Per-repo SSH keys for Git with core.sshCommand</title>
      <link>https://www.sebastientaggart.com/writing/git-per-repo-ssh-key-with-core-ssh-command/</link>
      <pubDate>Wed, 02 Aug 2023 20:18:43 -0400</pubDate>
      <guid>https://www.sebastientaggart.com/writing/git-per-repo-ssh-key-with-core-ssh-command/</guid>
      <description>Store the right SSH identity in each clone’s .git/config so you stop prefixing every Git command or maintaining a giant ~/.ssh/config.</description>
      <content:encoded><![CDATA[<p>If you keep more than one GitHub (or GitLab, or whatever) identity, you usually end up with more than one private key. The usual fixes are <code>Host</code> aliases in <code>~/.ssh/config</code>, or typing <code>GIT_SSH_COMMAND='ssh -i ~/.ssh/some_key -o IdentitiesOnly=yes' git …</code> before every command. Both work. Neither is what I want when I just opened a random repo in a deep path and want my fingers to do the right thing.</p>
<p><strong>Reminder:</strong> you can pin the SSH command on a single clone:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git config core.sshCommand <span class="s2">&#34;ssh -i ~/.ssh/your_private_key -F /dev/null&#34;</span>
</span></span></code></pre></div><p>That lands in <code>.git/config</code> for that repository only. Every <code>git fetch</code>, <code>git pull</code>, <code>git push</code> from that directory uses that key. No wrapper script, no repeated env var.</p>
<p><code>-F /dev/null</code> tells <code>ssh</code> not to read your normal config file for that invocation. That matters when your global config would otherwise offer several keys and confuse <code>github.com</code> about which one you meant. Pair with <code>-o IdentitiesOnly=yes</code> if your agent still tries to hand out the wrong identity first.</p>
<p>This does not travel with the remote (<code>.git/config</code> stays local), so a fresh clone needs the line again, or you automate it once in a bootstrap script. For “this laptop folder always means my work GitHub,” that tradeoff is usually fine.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
