<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Tech Cafe - Git</title>
    <subtitle>Dev adventures, epic bugs, tiny wins, and the occasional meltdown.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://golden-fox.dev/tags/git/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://golden-fox.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-08-26T00:00:00+00:00</updated>
    <id>https://golden-fox.dev/tags/git/atom.xml</id>
    <entry xml:lang="en">
        <title>Git Archaeologist</title>
        <published>2026-08-26T00:00:00+00:00</published>
        <updated>2026-08-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Aakriti Agarwal
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://golden-fox.dev/projects/git-archaeologist/"/>
        <id>https://golden-fox.dev/projects/git-archaeologist/</id>
        
        <content type="html" xml:base="https://golden-fox.dev/projects/git-archaeologist/">&lt;p&gt;Git’s forensic tools are surgical. &lt;code&gt;git log -S&lt;&#x2F;code&gt;, &lt;code&gt;git blame&lt;&#x2F;code&gt; and &lt;code&gt;git bisect&lt;&#x2F;code&gt; each answer
a precise question you already know how to ask. I wanted to know whether a model that can
hold an entire repository history in context answers a different kind of question, the
diffuse kind where the answer lives across many commits at once.&lt;&#x2F;p&gt;
&lt;p&gt;So I built a harness: ten questions against one real repository, with ground truth
verified by running &lt;code&gt;git&lt;&#x2F;code&gt; rather than by trusting my memory. Three of the ten were
negative controls, asking about things that never happened, because a model that agrees
with every premise you hand it is not doing archaeology.&lt;&#x2F;p&gt;
&lt;p&gt;The model answered 10&#x2F;10 correctly, including all three controls, and cited 103 commit
SHAs of which 102 resolve to real commits. It fabricated nothing. It was also between 150
and 4,000 times slower than Git on the questions Git can answer.&lt;&#x2F;p&gt;
&lt;p&gt;The result I did not expect was a ceiling. Datasette is a mid-sized project, nine years
and 3,406 commits, and its full history is roughly four million tokens, about four times
the window. I stripped docs, lockfiles, images and vendored assets, then capped diff
sizes, and never got within twice the budget. The bulk is not a few large blobs, it is
2,663 commits of real source diff. The run used the largest chronological prefix that fit,
which was the first 31%.&lt;&#x2F;p&gt;
&lt;p&gt;So “put the whole history in context” has a size limit that nobody advertises, and for any
project with real history you are already past it. Worth measuring before you design
around it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Built with:&lt;&#x2F;strong&gt; Python, Git, OpenRouter&lt;&#x2F;p&gt;
&lt;p&gt;Repo is private for now.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Managing Multiple Git Identities on One Machine</title>
        <published>2026-02-05T00:00:00+00:00</published>
        <updated>2026-02-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Aakriti Agarwal
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://golden-fox.dev/til/git-identities/"/>
        <id>https://golden-fox.dev/til/git-identities/</id>
        
        <content type="html" xml:base="https://golden-fox.dev/til/git-identities/">&lt;p&gt;&lt;strong&gt;TL;DR: Want separate Git emails per project? Just don’t use &lt;code&gt;--global&lt;&#x2F;code&gt;.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The Problem:&lt;&#x2F;strong&gt; So I ran into this situation where I needed one project folder to use my university credentials while keeping my personal Gmail for literally everything else in VS Code. Classic identity crisis, but make it Git.&lt;&#x2F;p&gt;
&lt;p&gt;Honestly thought this would be a nightmare to set up, but Git actually makes it pretty straightforward once you know the trick.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;solution-local-vs-global-git-config&quot;&gt;Solution: Local vs Global Git Config&lt;&#x2F;h3&gt;
&lt;p&gt;Here is the thing I wish someone had told me earlier: &lt;strong&gt;stop using &lt;code&gt;--global&lt;&#x2F;code&gt; for everything.&lt;&#x2F;strong&gt; I know it is tempting (one command and you are done!), but global configs apply to every single repository on your machine. Not ideal when you are trying to keep things separate.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;For personal identity  (global):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#657B83, #839496); background-color: light-dark(#FDF6E3, #002B36);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#268BD2, #268BD2);&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt;-global&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; user.name&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;personal username&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#268BD2, #268BD2);&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt;-global&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; user.email&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;personal email&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;For uni project (local: run this inside that specific folder):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#657B83, #839496); background-color: light-dark(#FDF6E3, #002B36);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#268BD2, #268BD2);&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; user.name&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;uni username&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#268BD2, #268BD2);&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; user.email&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;uni email&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;See the difference? No &lt;code&gt;--global&lt;&#x2F;code&gt; flag means the config only applies to that one repository. Problem  solved.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Paranoid and want to verify?&lt;&#x2F;strong&gt; I found this super helpful command to check which email was actually used for your last commit:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#657B83, #839496); background-color: light-dark(#FDF6E3, #002B36);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#268BD2, #268BD2);&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; show&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt;s&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#CB4B16, #CB4B16);&quot;&gt;-format=&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;Author: %ae%nCommitter: %ce&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#2AA198, #2AA198);&quot;&gt; HEAD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This shows you both the author and committer email from your most recent commit. Saved me from some potential embarrassment when I wasn’t sure if I had configured things correctly!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;bonus-learning-git-reset-flags-proceed-with-caution&quot;&gt;Bonus Learning: Git Reset Flags (Proceed with Caution)&lt;&#x2F;h3&gt;
&lt;p&gt;I also learned about &lt;code&gt;git reset&lt;&#x2F;code&gt; and honestly it is Kind of terrifying.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset --soft HEAD~1&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Removes your last commit but keeps all your changes staged. Perfect for those “oops, typo in the commit message” moments. Very forgiving, 10&#x2F;10 would use again.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;git reset --hard HEAD~1&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Deletes the last commit AND all your changes. Like completely GONE. Forever. No take-backs. (Yeah… never gonna try using &lt;code&gt;--hard&lt;&#x2F;code&gt; unless I am absolutely certain and have sacrificed the appropriate offerings to the Git gods.)&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Real talk:&lt;&#x2F;strong&gt; Always double-check before using &lt;code&gt;--hard&lt;&#x2F;code&gt;. Your past self worked hard on that code, and your future self will definitely not appreciate having to rewrite everything at midnight.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
