<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lalith B Seervi on Medium]]></title>
        <description><![CDATA[Stories by Lalith B Seervi on Medium]]></description>
        <link>https://medium.com/@lalithbseervi?source=rss-ae661168bfd2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*P54NohTYeS9v4_RL</url>
            <title>Stories by Lalith B Seervi on Medium</title>
            <link>https://medium.com/@lalithbseervi?source=rss-ae661168bfd2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:35:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lalithbseervi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Git Worktrees: The savior I didn’t know I needed]]></title>
            <link>https://medium.com/@lalithbseervi/git-worktrees-the-savior-i-didnt-know-i-needed-1eeac765ef30?source=rss-ae661168bfd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eeac765ef30</guid>
            <category><![CDATA[git-worktree]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[parallel-development]]></category>
            <dc:creator><![CDATA[Lalith B Seervi]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 04:23:19 GMT</pubDate>
            <atom:updated>2026-11-19T04:23:19.397Z</atom:updated>
            <content:encoded><![CDATA[<p>We all know the feeling: You’re deep in a complex feature, but a new bug needs to be addressed immediately. The traditional approach of creating temporary branches, stashing changes, and switching back feels like extra work that is cumbersome and sometimes confusing.</p><p><strong>What are worktrees, and how do they solve this problem?<br></strong>A worktree is essentially a way to give you <strong>parallel workspaces</strong>. Instead of keeping all your development efforts limited to one directory and one branch at a time, worktrees allow you to maintain multiple, independent directories — one for each branch, all of which are linked back to the same repository.</p><p>The true power of worktrees lies in eliminating friction.</p><ul><li><strong>No More Stashes:</strong> The biggest time sink? Managing stashes and <br>re-applying changes. With worktrees, you simply navigate to the workspace you need and start coding — no temporary saves required.</li><li><strong>Instant Context Switching: </strong>Need to debug Feature A while actively <br>building Feature B? You don’t have to commit or stash anything. You just switch directories and immediately regain your focus.</li><li><strong>Pure Parallelism: </strong>Worktrees allow you to work on entirely separate <br>lines of development simultaneously, which is invaluable when dealing with complex integrations or multiple AI agents running parallel tasks.</li></ul><p><strong>My Experience: Solving the Multi-Tasking Headache<br></strong>I first realized how indispensable worktrees were while working on a major website project. I was balancing three critical demands: building a core <br>feature, integrating third-party analytics (like Posthog), and addressing <br>immediate bug fixes.</p><p>By implementing worktrees, I created three distinct working environments. If I hit a roadblock on the core feature, I could instantly pivot to the analytics integration workspace without losing my place or cluttering my history. This allowed me to stay productive and avoid context-switching fatigue.</p><p><strong>Beginner’s Guide to Worktrees</strong><br>Setting up a worktree involves using a bare clone and then using the `git <br>worktree add` command to create your parallel environments.</p><p><strong>1. Prepare the Repository (Bare Clone)<br></strong>Worktrees typically operate from a bare clone to manage the references <br>cleanly.</p><pre>git clone — bare https://github.com/username/repository.git</pre><p><strong>2. Configure Remote Fetching</strong><br>Since we are using a bare clone, we need to tell Git how to handle remote <br>fetching for this setup.</p><pre>git config remote.origin.fetch ‘+refs/heads/*:refs/remotes/origin/*’</pre><p><strong>3. Create the Worktree<br></strong>Once inside the repository directory, you can add your worktrees:</p><ul><li><strong>Adding a new branch:</strong> Use `-b` to create and switch to a new branch <br>immediately.</li></ul><pre>git worktree add -b hotfix-work main</pre><ul><li><strong>Adding an existing branch:</strong> Specify the target branch relative to <br>the repository.</li></ul><pre> git worktree add -t feature-work origin/feature-branch</pre><p><strong>References:</strong></p><ol><li><a href="https://youtu.be/2uEqYw-N8uE">Git’s Best and Most Unknown Feature — ThePrimeagen</a></li><li><a href="https://youtu.be/_bTawUNpWcI">Worktrees: The Secret Sauce to Claude Code!</a></li><li><a href="https://www.youtube.com/watch?v=b46GKAnH89I">How to Use Git Worktrees to Switch Contexts Quickly and Easily — Josh Medeski</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eeac765ef30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>