Git Worktrees Tutorial #5 - Worktrees in Agentic Coding Workflows
Key Takeaways
The video tutorial covers using Git worktrees in agentic coding workflows, allowing for multiple branch checkouts in separate directories. It's part of a larger Git and GitHub masterclass series by The Net Ninja.
Full Transcript
Okay, then my friends, so we've learned about Git work trees now and how they can be useful in a regular development workflow because they allow you to easily switch between multiple branches and work on different things at once. And because of that, they've become increasingly popular with agentic coding workflows as well because now instead of getting Claude code or Gemini CLI or whatever else working on just a single feature at time, by using work trees, you can work on multiple features at once or iterate on the same feature in two different sessions to see which implementation you prefer. So, I've already created another work tree in this project called feature XYZ and I've got two terminal windows open as well. One for the feature ABC work tree and one inside the feature XYZ work tree. And what I might do is start in one of these sessions to create some new feature. For example, I could say here that I want it to flesh out an about page, which is a very simple task, but it serves as an example. So then, let's hit enter to send this prompt. And now while it works, instead of just sitting around waiting, I can switch to my other work tree and work on another feature at the same time. Now, I can either do that manually or use another Claude session to let the coding agent work on something else, which is what I'm going to do right now. So, I'll ask it to make a contact page with a contact form in it and it can go ahead and work on that feature at the same time that Claude is working on something else up here. And that saves a little bit of time, right? Rather than sit around waiting for one task to complete before we start another, um I can just get them both running at the same time. And I know that these two features were really basic and they'll only take Claude about a minute or so to complete, but sometimes when I'm working on features, it can be spinning around for 7 or 8 minutes before it's finished. And in that time, I can either just sit around twiddling my thumbs, scroll YouTube, which is always fun, or I can spin up a new task in a different work tree. Now, I'm not one of these kind of power users, as they're called, who spins up five or six different sessions at once because I think for me that would become a little complex to manage and it would probably result in a fair few conflicts which I'd then have to resolve manually. Uh so I think for me two is enough, three in a push when I really want to get things done. And uh the process beyond this agentic workflow is pretty much the same as before. We can review the code locally, make a commit, push up to GitHub, and merge. Now something else I occasionally do is create some kind of custom slash command in Claude Code which instructs the agent to autonomously add a new work tree and branch whenever it begins a new feature. And that way I don't even need to worry about manually creating them myself. I can just run that custom slash command along with a feature spec and Claude Code will do it for me. If that's something you're interested in, do let me know. And also if you want to learn about Claude Code in more depth and how I like to set up a spec-first agentic workflow, then definitely check out my Claude Code masterclass on netninja.dev. It goes into a lot of detail about feature development uh utilizing custom commands, sub-agents, MCP servers, and Git and GitHub as well. So I'll leave the link to that course down below the video. Anyway, hopefully now you can see the benefit of using Git work trees both for agentic workflows and just regular development workflows as well when you're not using coding agents. And that's pretty much the end of this small series. So I really hope you enjoyed it and hopefully now you know what Git work trees are. If you did like it, please don't forget to share, subscribe, and like. That really helps a lot and I'm going to see you all in the next one. >> [music] [music] [music] >> Oh. Oh. Oh. Oh. Oh. Oh. Oh.
Original Description
In this series, you’ll learn how to use Git worktrees, a feature that lets you check out multiple branches at the same time in separate working directories.
🍿👇 Get the FULL Git & GitHub Masterclass:
https://netninja.dev/p/git-github-masterclass
🍿👇 Get the FULL Claude Code Masterclass:
https://netninja.dev/p/claude-code-masterclass
🔥👇 Get access to ALL Masterclasss & premium courses with Net Ninja Pro:
https://netninja.dev/p/net-ninja-pro/#prosignup
Starter Project: https://github.com/iamshaunjp/portfolio-worktrees
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: Agentic Coding
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
X now offers an MCP server to make its platform easier for AI tools to use
TechCrunch AI
n8n Automation Repurpose Video Content: The 2025 Production Guide
Dev.to AI
You’re Still Paying $200/Month for AI Tools You Could Replace With a Free Local Setup Tonight
Medium · Data Science
Top 10 AI Tools Every College Student Should Know in 2026
Medium · AI
🎓
Tutor Explanation
DeepCamp AI