<?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.tech/tags/git/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://golden-fox.tech"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-08-26T00:00:00+00:00</updated>
    <id>https://golden-fox.tech/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.tech/projects/git-archaeologist/"/>
        <id>https://golden-fox.tech/projects/git-archaeologist/</id>
        
        <content type="html" xml:base="https://golden-fox.tech/projects/git-archaeologist/">&lt;p&gt;Git has some really useful tools for digging through history. &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; can answer very specific questions, but I wanted to see if an AI model could answer the more complicated ones where the answer is spread across lots of commits.&lt;&#x2F;p&gt;
&lt;p&gt;So I built a small test harness with 10 questions against a real repository. I checked the answers against Git itself and included 3 questions about things that never happened to see if the model would just make something up.&lt;&#x2F;p&gt;
&lt;p&gt;It got all 10 right, including the 3 negative controls, and cited 103 commit SHAs with 102 pointing to real commits. The downside was speed. For questions Git could answer directly, the model was between 150 and 4,000 times slower.&lt;&#x2F;p&gt;
&lt;p&gt;I also found a pretty big limitation. The full history of the repo was around 4 million tokens, which was too large to fit in the model’s context window even after stripping out a lot of unnecessary files.&lt;&#x2F;p&gt;
&lt;p&gt;It was a fun experiment and a good reminder that “just put the whole Git history into the context” does not scale as far as it sounds.&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.tech/til/git-identities/"/>
        <id>https://golden-fox.tech/til/git-identities/</id>
        
        <content type="html" xml:base="https://golden-fox.tech/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.) Small plot twist though: the &lt;em&gt;commit&lt;&#x2F;em&gt; isn’t truly gone, &lt;code&gt;git reflog&lt;&#x2F;code&gt; can usually bring it back. Uncommitted changes are the part that’s really lost.&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>
