00:00.25 James Welcome back, everyone, to Merge Conflict, like your weekly developer podcast where we develop. I'm James. That's Frank over there. I'm a little bit cool. He's a little bit warm. And this episode is all about a bunch of spiciness. How's it going, Frank? 00:16.18 Frank That's right. ah Boy, you know, hot, cool, warm, none of those mean anything, because if you look at the color temperature of cameras, they're actually opposite. Cool colors are high temperature. 00:27.54 Frank Warm colors are low temperature. ah Spicy food is hot, even though it's not, you could have cold spicy food. What does anything mean in this world? 00:37.82 Frank Wonderful to see you, James. 00:40.31 James Uh, you hate my lighting, Frank, if you're watching on YouTube, i I usually set it relatively. I'm not a video person, right? I'd have to like call up Cameron and be like, Hey, so I'm i'm usually a rock, like 5,200 Calvins, Calvins. 00:55.65 Frank A little hot in here. ah h It's like you're up on an ah in an airplane. 00:58.39 James but But I set it down to 34% brightness. right So if I set that, I'm at 34. But if I'm all the way up to 100, it's like, wow, it's like real. 01:10.42 James But then I do this. Yeah. So I don't know if people have recommendations for me, i would love that. I have two Elgato key lights, a left and a right pointed at me over here. 01:23.36 James And then I have obviously pure white walls pretty much that are eggshell. 01:27.49 Frank Wow. 01:27.93 James I think they're eggshell. Yeah. And, uh, that's kind of where I leave it. I don't know. I do feel like I'm a a little bit. Paler than I should be like in real life. I think I'm more, I have a little tan. 01:39.16 Frank I call it the severance look. No, what you got to do for the full movie effect is you need one really cool, one really hot. Then you get the blue and the orange. You get your oranges and your teals. You get both in the same shot. 01:50.48 Frank And then if you want to go full Hollywood, you just have to have a purple light like blasting you from the top. 01:51.45 James Mmm. 01:55.56 Frank And then it looks like stage lighting. 01:55.86 James So I could do, how's that? 02:00.77 Frank It's definitely not what we're used to. 02:03.26 James So that would be like one, one really warm and one cool. 02:03.83 Frank Boy. 02:07.16 Frank Yeah, it's not quite dramatic enough. But yeah, ah stage lighting is so strange. Like when you watch the high production YouTubes, people have so many colors mixed in there. It's kind of crazy, honestly, I think. 02:22.13 Frank I watch a lot of Corridor crew, and they have like high, strong purple lights along with green lights shining on them. I'm just like, I'm not willing to go there. Nope, not doing it. 02:32.16 James Well, if anyone has any recommendations or wants to hop on a like this, 02:34.83 Frank I like this. I like what you just did. Yeah, you're looking good. You got got some specular over on your left. Looking good, James. 02:43.22 James but The walls are no longer white, and which is what they are. But so what I just did is I, my left light over here is at, they're both at a very low percentage. So both of them are at about 10% brightness. It was like 10% brightness. We're getting moody. 03:00.09 James But one, the left light is 100% at And the right, this one, 03:00.41 Frank Mm-hmm. 03:05.39 Frank Heck yeah. 03:08.95 James is one hundred percent cool at seven thousand 03:12.23 Frank That's what I'm talking about. 03:12.82 James But I, but i 03:13.49 Frank Contrast, baby. that's That's what makes things look good. 03:17.21 James yeah, I could play around with it. Um, all right, let's get in to this week's topic that I picked out for us. 03:18.58 Frank ah 03:24.44 James What is a work tree? 03:27.86 Frank What is a work tree? um Is that what you put your shoes on so they don't get smelly? I need one. ah I mean, um excuse me, my friend and needs one. Their boots keep getting smelly. I think they need a work tree. 03:43.48 James that No, it's not tree that goes to work for you. 03:44.73 Frank Nope, dang. 03:46.19 James No, um we're talking about a git work tree. 03:49.53 Frank Oh, okay. I feel like I should know this. um Is this, this is... 03:53.05 James Ah, oh, oh, hold on. Before you even say anything. 03:56.92 Frank Okay. 03:57.69 James The reason that we're doing this episode is that we're at a pivotal point for Git and how we build software on our local machine because Git work trees, in my personal opinion, have never been really that important until now, until a month ago or two months ago, and all these agentic developer tools started to integrate work trees into it. 04:01.67 Frank Mm. Mm. 04:08.19 Frank Uh-oh. 04:16.03 Frank Oh, boy. Oh, boy. 04:21.59 James But no one knows what a work tree is. So I want to talk about what a work tree is and then why you want to use it. And Frank doesn't even know what a work tree is. 04:28.54 Frank We're doing an education episode. 04:29.66 James and yes, yes. 04:31.01 Frank i feel like isn' it am I wrong? Isn't this just like the staging time? So like you have your commits, you got your branches. Those are very understandable. And then you're doing some edits and you're like, get add. 04:43.82 Frank Isn't it added to the work tree? Am I crazy? Isn't that what the work tree is? Or am I crazy? 04:48.44 James No. 04:49.01 Frank Nope, completely off. Okay. Is this some feature they added to get like three years ago and no one paid attention to? Sat closer? 04:57.81 James Uh, when was work tree added to get, uh, get work trees. 04:59.74 Frank ah 05:06.01 James Hold on. Copilot is spinning up here. it was added in 05:11.26 Frank 10 years ago. OK, so I'm a little bit slow to catching up. Fair enough. 05:15.51 James a bit if you think of a work tree like this, when you clone a repo, Frank, uh, set it. Correct. You have a branch. You also have. 05:26.36 James let's say in all intents and purposes, a work tree, right? Like you have one work tree and you have branches off of that one work tree. Okay. 05:37.02 Frank Fair. I mean, what what you really have is a hierarchy of commits and a branch is just a pointer to one of those commits. 05:43.86 James Correct. 05:43.98 Frank that's I prefer to keep it in simple database terms. Branches are pointers and the rest is just a tree of commits. 05:47.71 James Yeah. 05:51.29 James Yeah. That makes sense. Yes. 05:53.27 Frank Mm hmm. 05:53.70 James Um, now Let's say you wanted Frank to work on two branches at the same time on your machine. 06:03.68 Frank Oh, gosh. Nope. Nope. Nope. Not going to happen. Never. I do this sometimes, and then I just forget about the other branch and it goes away. um The other way I do it is I just make a second clone of the repo and keep out of a separate directory because that's how sophisticated I am. That's how I keep things straight. um Oh, boy. 06:26.48 Frank Yeah, I mean, I would just do two different branches. That's what I would do. If I'm working on two different things, two different branches. 06:31.97 James just toggle between them. 06:32.20 Frank That's how I roll. 06:35.75 Frank toggle as in type git checkout because I still rock the command line. I didn't, I, to this day, I still don't trust any, uh, git GUI stuff at all. Full stop. 06:46.18 Frank Period. Visual Studio, VS Code, get out of here. 06:47.36 James it. 06:49.26 Frank I'm command line only. 06:52.27 James Uh, yeah. Okay. So this makes sense. Okay. So when is there a case where you'd want to have multiple branches checked out at the same time on your machine? 07:02.69 James And the only way to really do this, okay. 07:03.51 Frank Oh, constantly. 07:05.21 James Yes. Constantly AB b testing, AB b testing. 07:06.91 Frank Constantly. Yeah, sure. 07:09.43 James Um, 07:10.55 Frank Working on two different things. Like, i'm I'm working on a feature right now, and a bug report comes in from a user, and I need to work on that bug. You switch back to main, do a new branch off of main, work on that bug there. 07:21.83 James Mm-hmm. 07:22.89 Frank Later on you're going to have to deal with the wonderful merge conflict that inevitably comes up. But, you know, um that is the get life merge conflict in. 07:32.45 James Yeah. So there's that reason. Uh, you might want to, like I said, AB tests, you might, yeah, I want to be working on a feature and a bug, something come up. 07:38.10 Frank Mm-hmm. 07:42.00 James You don't want to like, often you're working on a feature that you said, a bug comes up. You don't want to like mucks that together. So there's one of way, two ways of doing it. Frank described it. One, I think the worst part of my personal opinion is let's say you're working on code and like, I gotta to fix. I got a critical bug. My boss is like, go do this thing. 07:58.39 James Do you stash it? Oh, here stash it. 08:00.12 Frank No, never stash. 08:02.68 James You committed, I guess commits are free. 08:03.06 Frank I live the no stash life. 08:04.46 James Yeah. 08:05.10 Frank You know, it's funny though, because um a coworker of mine stashes everything. And it just freaks me out because like, there's nothing keeping that stash alive. 08:09.78 James Yeah. 08:14.03 Frank Nothing at all. Just just the whims of whoever implemented Git. i I guess you could say that for all of Git. But I feel so much better when there's actual commits. I hate stashes. 08:24.11 Frank Commit that puppy. Create a new branch if you have to. Commit that puppy. 08:28.41 James Yep. So that's fascinating. Heather is a stasher. She's a, she's a, she's a, she's a, she's a stasher. 08:33.11 Frank Oh, no. Whoa. 08:36.54 James She's like, Oh, let me just stash. was like, Oh yeah. 08:38.10 Frank That's a personality test, I feel like. Yeah, we should just, at every conference, ask someone, stash or commit. 08:43.83 James Yeah. Spaces or spaces or tabs. And, um, I, I do think it's really fascinating to think about that because yeah, you have to do one of two things to be able to, to, to do that. You have to either commit or stash and then switch contexts, go over here, you know, hope your ID response to stuff. You have made that many drastic changes, close the thing where you go, reopen it. Um, 09:05.30 James The other thing is you said it earlier, which is the thing I used to do all the time, which is I would just copy the folder, clone it. 09:12.28 Frank Yeah, baby. 09:14.01 James So I'd have my app copy one. And then guess what? That entire clone of the folder is now is is, is ready to go. It's like, Hey, let's do this, you know? 09:25.34 James And it sends off to the races. 09:25.59 Frank Yeah. Sometimes I just declare get bankruptcy sometimes too. Under two conditions, I've totally screwed up a commit. like Usually it's a partial rebase or something where I've just created an absolute disaster, and that's when I'll create... like ah I'll just go bankrupt. I call it get get bankruptcy, and you just start with a fresh clone. I think the other time is It's just when you're you're getting too many local branches and you don't want to push them up and I'm just getting nervous. like ill i'll 09:58.86 Frank I'll go so far as like say I'm like code reviewing someone else's PR. Sometimes I'll have a separate directory just for PRs because i don't want them to mess with my main one or mix in a bunch of weirdo branches into my local stuff. 10:06.63 James Yeah. 10:13.85 James Yeah, it makes a lot of sense. Yeah, I think this has been one of the biggest problems I think, honestly, probably because of just tooling and or lack of knowledge of the feature. I hadn't really ever been introduced to WorkTrees at all up until a few months ago when the ability to manage WorkTrees Landed in VS Code. 10:34.98 Frank Oh, okay. 10:34.94 James I actually interviewed the engineer that worked on it for the VS Code Insiders podcast, VSCOpodcast.com. You can go check that out. But it landed this summer, I want to say, inside. 10:46.42 James And ah I was like, well, I guess I need to figure out what it is. Well, let me tell you what it is, Frank. WorkTrees. 10:52.82 Frank Oh, I'm excited. Okay, what is it? 10:54.40 James WorkTrees, they allow you to check out multiple branches simultaneously on your local machine. 11:01.49 Frank insanity. 11:02.39 James How does this work? And I'm glad you asked. 11:04.68 Frank OK. 11:05.02 James What they do is it, um, for all intents and purposes, it's doing the thing that I just kind of talked about is it is making a copy of the source code of a branch that you specify and putting it in another folder. So if you have my app, that's the folder you would in the route. let's say you have C slash my app. 11:27.13 James You say, let me create a work tree. You can specify the work tree of any branch you would like to create it off of. So you might have a work tree, uh, off of. 11:35.20 Frank OK. 11:38.04 James Uh, main, which is called experimental or experiment one experiment to experiment three. You might have one called hot fix, get up, blah, blah, blah. It's basically, you're creating a, a, you're going to create a work tree off of a branch with a branch name. 11:53.49 James So all you're doing is creating a branch of a branch, but you're saying that this is a work treat, not a standard branch. 11:54.47 Frank OK. 11:59.35 James Okay. 11:59.83 Frank But you usually start with a branch. That's usually your starting point for a work tree. 12:04.99 James Uh, you can do it off of main. mean, it's fine. 12:06.94 Frank ah Sorry, Maine is a branch. Maine's just the name of the first... 12:09.34 James Main is a branch. 12:10.50 Frank bre Yeah, it's all branches all the way down. 12:10.59 James Yep. Yep. Yeah. It's all the way down. Exactly. Now you might be saying like, Hey, and know I'm going to work on this feature. So let's say you have like, you know, login redesign. 12:21.85 James So normally you're like, okay, I've logged redesign. then you're like, I'm going to get to work. Well, actually I want to have like three different designs. So what I'm going to have then is I'm going to create three work trees off of redesign and call it redesign one redesign to redesign three. 12:33.75 Frank Okay. 12:38.33 James I can open up all three of those in different instances of VS code and be working on all three of them at the same time. And then I can merge that work tree back into the branch that it was created off of. 12:45.21 Frank Cray cray. 12:48.80 James Okay. 12:50.78 Frank Oh boy. Okay. Where do you even begin? Okay. 12:53.07 James Well, me tell you it works. Let me tell you how it works. So when you do this, Frank Kruger, it will create another folder called, you know, my app dot work trees, and then create the work trees in that folder. 12:54.94 Frank Okay. 12:57.58 Frank Uh 13:00.88 Frank huh. 13:05.34 James So they're nicely organized in a separate folder between them. 13:06.42 Frank Okay. 13:09.07 James Okay. Now, when you go into VS code, you go into VS code, you can do it alongside with me, go into VS code, go in. 13:10.22 Frank Okay. 13:19.19 Frank All right. 13:19.93 James Go. Yep. Yep. Okay. 13:22.12 Frank I'm in it. 13:22.95 James You're in it. Okay. Go into your source control. That's the little thing that looks like a little branch. Okay. 13:28.63 Frank Love it. 13:28.70 James See up source top you have source control. Do you have repository changes and graph? 13:32.76 Frank m 13:35.83 Frank Let me open a project that's probably going to be helpful for this experiment. 13:39.70 James Step one, open said project. 13:41.11 Frank ah Okay, I have changes, changes, and graph. 13:47.77 James Ah, cool. So go up to the triple dot under source control and check repositories. 13:48.60 Frank Did that help? Aha. 13:52.85 James Okay. 13:53.94 Frank Oh, okay. um Still not finding it, James, but okay. 13:56.98 James Okay. The repositories just as repositories source control. There's a triple dot at the very top. 14:05.48 Frank Nope, pull, push, clone, checkout, too, fetch, commit, changes, pull, push, branch, remote. 14:08.63 James Nope. you Nope. One up. You got to go higher source control. 14:11.06 Frank oh So high. Oh my. Let's see. Okay. Look, I'm going to blame VS Code for this. there are There's at least six different three dot things on my computer. 14:19.80 James All the way to the top. 14:20.22 Frank I found it, James. Repositories. 14:22.36 James Notorious. 14:22.78 Frank Okay. 14:23.06 James Okay. 14:23.34 Frank Got it. 14:23.96 James Then you see the name of your app. It looks like there's a little book there. 14:26.65 Frank Yep. Mm-hmm. 14:27.30 James You're on a branch. There's a little spinny icon. 14:28.85 Frank Mm-hmm. 14:29.86 James There's a little creative pull requests icon. 14:31.16 Frank A little cloud for me. Yeah, it's cute. 14:32.63 James Then there's a trip. Then there's a triple dot more actions. 14:34.97 Frank Of course there is. Yeah. 14:36.50 James This is your pool, push clone, check out fetch. 14:39.00 Frank Yeah. 14:39.06 James Okay. Work trees, create work tree. 14:42.90 Frank Oh my god, what's going to happen? OK, there's a dot dot dot after it, so I better bring up a dialog box. 14:45.43 James So 14:49.05 James pick a branch. 14:49.52 Frank Ooh, it brought up the only dialog box VS Code has. So I pick a branch, or should i create a new branch? 14:52.91 James Yep. Yeah. Just pick a, you can do either. Yep. 14:57.62 Frank Yeah, I'm going to pick a branch, James. I'm going to pick main, because that's how I roll. 15:04.25 Frank It says branch main is already checked out in the current repository. Create new branch. All right, fine. 15:08.92 James Oh yeah. i guess you do need to do it off a branch. 15:09.49 Frank I'll create a new branch. Okay, they want a new branch. 15:10.68 James Okay. Call it new branch. 15:12.05 Frank I'm going to call it James because that's a good name for a branch. 15:14.64 James I'm calling mine Frank. 15:16.09 Frank ah 15:17.72 James Ah, yes. I guess you need to have a branch and then it puts it in the branch name. Okay. So then it's going ask you where you want to put it 15:22.16 Frank Right. 15:24.54 James Mm-hmm. 15:24.63 Frank and it is putting it in um so project name dot work trees so it's like um it's a new top level directory though which is kind of interesting so it's not like a dot work trees directory in the directory it's a whole and nother directory fascinating 15:24.68 James Mm-hmm. 15:46.04 James Yeah. And I think what was happening there when we selected, when we were selecting main, I think we are creating this new work tree off of main. Cause it's like the thing that we currently have checked out. I'm pretty sure. 15:57.40 Frank Okay. 15:57.62 James I think. Yeah. 15:58.55 Frank Well, I have a thing called James now. i'm I'm now scouring my computer to figure out what it's done. 16:01.37 James You do. 16:05.19 Frank Okay, so it did create a whole new top-level directory. So let's say my project was called project. There's now a new folder called project.worktrees, not project slash dot worktrees, project dot worktrees. 16:17.08 James Correct. 16:18.31 Frank Interesting, interesting. but us And then there is a slash James under that. Fascinating. 16:25.16 James Yep. 16:26.17 Frank Okay. 16:26.23 James So what has happened here for all intents and purposes is that when you call get in it or get clone, that's going to create your main work tree, which is what we're working off of, but this is just created a new link work tree. 16:38.14 James So a repository has one has one main work tree. 16:38.63 Frank Mm-hmm. 16:41.31 James It's the one in the repo and usually zero link work trees. And I have a link to work tree. So now you have a link work tree and it's there and now you can work off it and you can create more work trees. So if you want to see, you can have James one, James two, James five, James 10. 16:55.61 James And here's the cool part. 16:56.32 Frank Oh, I'm doing it. 16:57.30 James Now, what I want you to realize though, in your VS code, you're still on main Frank. Look at your bottom left. 17:03.38 Frank I guess I don't even know what I'm on, man. i am i am in a new universe, it feels like. 17:06.35 James Yep. No, you're, you're in bottom left. You're in bottom left, bottom left. See, it says main. 17:11.61 Frank Uh-huh. It does say main. I'll grant you that. 17:13.64 James Okay, so go to the James work tree under changes, or even actually under repositories, you see, you see your project, then James, James branch, go to the triple dot dot. 17:19.90 Frank Mm-hmm. 17:23.13 Frank Yeah. 17:24.25 James dot 17:25.34 Frank But is it a branch? It is a branch. 17:27.00 James It is a branch, but then you can go to work trees and you can say open work tree in a new window and you'll get a new VS code with that branch of the work tree that is on your machine. 17:28.38 Frank Okay. 17:33.00 Frank Aha. 17:39.67 Frank That totally worked. 17:40.07 James Okay. Yes. 17:41.40 Frank That did work. I would admit that worked. 17:42.74 James That. Yep. So now, so now you have two VS codes, put them side by side people. 17:44.47 Frank ah 17:48.60 James So on the left you have main and on the right you have James. 17:48.70 Frank I did. 17:53.56 James Okay. Now go into your read me. 17:54.97 Frank Can I tell you something that I like already? Sorry, to just to interrupt you. 17:57.43 James Go ahead. 17:59.37 Frank um You know, I keep a lot of files in my projects that aren't actually a part Git because that's how I roll. 18:06.07 James Yeah. 18:06.14 Frank um This was fun because this did the kind of thing I was talking about before when you get too many files in your Git and you just want to clean one and you like do a reclone of it. Because obviously when it created this James work tree thing, it only brought over the Git controlled files, nothing else. 18:15.32 James Yeah. 18:23.03 Frank So it was actually kind of a fun, quick way to just see um not the garbage that I normally, all the detritus that I keep around in my directories. 18:23.44 James Correct. 18:28.44 James Not the garbage. Yeah. 18:32.50 Frank So I like that part already. 18:32.93 James Yep. 18:35.54 James So now here, um, if you go to your James branch that you've created, go to your read me and just update the read me to say James and save it. 18:41.96 Frank Mm-hmm. Mm-hmm. 18:46.39 Frank James approved. Yep. 18:47.89 James James approved. Cool. Now what, then what I want you to do is go back to your other repo. 18:52.25 Frank Yep. 18:56.70 James The other VS code, which is on main, and then you can see there's changes. 18:58.26 Frank Aha. Yep. 19:01.14 James Okay. And then what you're able to do is now commit those changes to that branch on that machine. 19:12.31 James Right? 19:13.00 Frank I didn't change anything on my main. 19:14.90 James No, you didn't, but see where it says changes. This has main Anna has Frank or James underneath it. 19:20.89 Frank Uh-huh, I can do it there. 19:21.66 James Yep. 19:22.42 Frank Fair enough. 19:22.46 James You can do it there. So you can do it in either. 19:24.02 Frank Oh! Right, got it. Okay. Boy, this is not going to confuse me at all in the future. 19:27.80 James Okay. 19:31.18 Frank I'm just kidding. 19:31.62 James Yeah, but it's kind of crazy, right? 19:32.14 Frank Well, I'm not kidding. 19:33.65 James You now have two branches checked out at the same time where you'd be working on two different problems. 19:34.81 Frank Yeah. 19:39.66 Frank Let's see how good their sync is. 19:40.41 James Okay. 19:41.14 Frank i am going to commit this, buddy. Commit. Commit. I have a bug report already. I committed on the left window. oh wait. 19:51.03 James You got to click here. 19:51.46 Frank No, no. I got to do a commit message. Hi. 19:54.20 James Mm-hmm. 19:59.35 James You might get the little refresh button on the other one, but 20:05.45 James okay. 20:07.32 Frank Oh, no. ah When I switched back to the window, it updated the UI. So, OK. So you do have to do the little switchy switchy switch. 20:12.41 James Oh, perfect. 20:14.96 Frank But yeah. Okay, that worked. That worked. um 20:19.29 James Okay. 20:19.62 Frank It's still just in a branch, though. So i to get some reassurance here, James, I just need to go at the command line, get branch list to prove to myself what the heck is going on with this thing. 20:28.27 James Hmm. 20:31.29 Frank Okay. 20:31.51 James But you're in a work you're in a work tree now, so remember that. 20:34.90 Frank I don't know what that means, but OK. the I mean, the branch is there. um Fantastic. OK. What happens if I go to the command line version of this new directory? I'm curious. 20:48.50 James good question. What does it say? 20:50.49 Frank I am almost there. If you go into work trees, nothing. If you go into James, it looks like a git directory. Fascinating. 21:01.75 Frank Fascinating. And if you print the git directory, 21:08.89 Frank Nothing. Oh, OK. the Fascinating. the got The dot get directory is not a directory. It's some fancy work tree thing. 21:23.61 Frank Great. 21:23.69 James It is a work tree thing. 21:24.21 Frank that's That's as far as I'm going to dig into that. 21:27.74 James Correct. So it's like not only created that branch, but it's also created this work tree where that branch lives. Right. So think of it as basically the, it's a little confusing because the name of the, the name of the work tree Frank and then your branches Frank, but now your work tree can have multiple branches inside of it. 21:40.64 Frank Yeah. Yeah. 21:45.46 James Okay. And you can have multiple work trees as well. 21:47.90 Frank yeah 21:48.54 James on it. And then ideally the other thing that you can do is you want to get those changes in that work tree back into your main work tree. It's kind of like a flip of the script, which is like, Hey, I have like a bunch of branches, but now I actually have like multiple work trees that have multiple branches that I'm working off of to put back into my actual main line work tree and main branch. 22:12.76 Frank Yeah, and it's fascinating too because this work tree really is a special place. So I just, the big question I had was like, are the remotes the same and things like that? 22:23.48 Frank And as far as I can tell, the remotes are the same. So I don't even know how this Git file is actually pointing back to everything. It's honestly awfully confusing. 22:34.46 Frank I should say, it's not it's not awfully confusing. 22:34.58 James It's a little confusing, yes. 22:37.82 Frank Conceptually, it's pretty simple. they They made another directory with um my repository, created a subdirectory for the the start of that work tree. 22:48.48 Frank Fine. Because I actually have two. I have James and James2 now. So that's fine. 22:52.53 James Yeah. 22:52.95 Frank Yeah. 22:57.11 Frank It could get confusing, but I'd say this probably is better than me just cloning two different directories. that that you know That's that's the the bar I'm measuring this against. 23:07.34 Frank I feel like, because both of those can obviously be confusing. I'm feeling like this is probably better. I'm a little more okay with this, actually. 23:13.21 James yeah So here's exactly what happened. So when you create a work tree in Git, you're essentially telling Git, give me another working directory that's tied to the same repository, but checked out to a different branch or commit. 23:27.93 James So literally step-by-step here's what's happening. A new directory, which you said is specified. The directory looks like a normal Git working copy, but it doesn't have its own Git folder. Instead, it has a small.git file that points back to the main repository's object database. This is a huge thing in which you just investigated, correct? 23:47.14 James Git records in the work tree has its own internal metadata, which are inside.git slash work trees. 23:47.43 Frank Yeah. 23:53.72 James And this keeps track of which branches are checked out to which work trees. So you don't accidentally check out the same branch in two places. So what this allows you to do is work independently in that new directory, in that new directory commit, merge, run tests. 24:07.16 James It behaves like a full repo checkout, but it shares the underlying objects in the main repo. 24:10.40 Frank Yeah. 24:12.28 James So why would you really want to do that, right? Like we said, it allows you to check out branch X on a work tree. And then, you know, that way don't have these like conflicts, basically, when you're doing work. 24:22.74 James And it also saves space because you're sharing the same object database. So you don't duplicate the entire repo because one of the problems is if you were to download VS code and then you needed to work on two branches, it's like a gig each, right? 24:36.22 James But really a lot of visit in that is in that dot get folder. 24:37.10 Frank Mm-hmm. Yeah. 24:40.54 James So you save tons of that. So creating these work trees gives you a lightweight parallel workspaces. right to keep your main spin up work trees for hot fixes work on experiments that we don't to worry about juggling stashes or clones or things like that in general 24:56.09 Frank Yeah, and I was just doing a tiny bit of investigation. So yeah, that.git is actually just a text file pointing back to an absolute path of the actual.git. 25:07.99 Frank slash sorry the docket slash worktre so yeah, it created a new little subfolder And it's interesting because that the WorkTree subfolder is very much like a.git, because it has refs, it has head, it has index, it has logs. 25:29.24 Frank who Who cares about logs? 25:29.54 James Yep. 25:30.52 Frank But it doesn't have objects. It doesn't have the actual data. So because it has refs, it is acting a lot like an actual git checkout, but it's doing the magic so that the the object database is shared. 25:46.22 Frank Really fascinating stuff, which really makes me think you can really hack around with this. 25:46.46 James Yep. 25:52.02 Frank And put the WorkTrees stuff anywhere on your computer. So long as that, yeah, so long as that git, the.git file points back to the WorkTrees subfolder of your.git. 25:56.21 James Oh, totally. 26:05.42 James Yep. Yep. 26:07.15 Frank Yeah, not bad. Not bad. But that also explains, I should say, there's no config file there. So that explains why the remotes are the same. I have to assume all the submodules would be the same. as Submodules get a little bit weird, though, so I'd like to see how it handles those exactly. But it looks like it's only really making a copy of head and refs, which are your your pointers into the object database, into the commit database. 26:33.08 James So now you'd be saying, I made these changes. How do I get them back into Maine? How do I get them back into my main work tree? 26:41.56 Frank I assume it's sharing the refs folder. So if I merge something into um the the named main branch, it would just go there. like I'm feeling like it's just going to rewrite the main ref, the main branch, to be the commit that I tell it to be. 27:04.95 Frank Is that it? do i Can I just say that? Can I just merge it on into the into a different branch? 27:11.61 James I like, oh yeah. Like, could you take the work for them, merge it back into main maybe in VS code, go to the, go to the command, go to the command palette up top and then do, you know, less or greater than, and then type in work tree and you're going to see migrate work tree changes. 27:16.91 Frank Mm-hmm. Okay. Not the recommended way. Okay. Okay. Yeah. 27:26.46 Frank Uh-huh. Yeah. 27:31.70 Frank What? What does that mean? You're really blowing my mind tonight, buddy. 27:35.68 James Um, 27:40.21 Frank Oh, okay. You want to do this on the main repo side, it seems like. 27:43.83 James Oh, yes, you need to do that on the main repo side. That is correct. Yeah. Not on the actual. 27:49.30 Frank Oh my god, it just created something called Dirty Taken. What does that mean? 27:56.60 Frank That's hilarious. 28:01.98 James Think, I think you might also have to, i don't think you have to publish it Migrate work tree changes. i have mine says none are available. But the migrate should bring it back to it. 28:21.69 Frank Oh, you know what? 28:21.93 James Migrate. 28:23.09 Frank I'm bad at following your directions. What I did instead was create work tree with defaults. 28:26.29 James Oh. 28:29.49 Frank And with defaults means it made up some random name. 28:30.04 James and 28:32.85 Frank And the random name is terrible. It's called dirty hyphen taken. Terrible, terrible git people. 28:36.80 James Oh. 28:39.32 Frank Let me try again actually doing what you told me to do. 28:45.12 Frank OK, migrate work tree changes. Bam. OK, now I can say select a work tree to migrate changes from James. 28:52.98 James From, yeah, into. 28:55.03 Frank And I don't know where they went, but that was it. 28:59.84 James Yeah. 29:00.02 Frank There are no changes in the selected work tree to migrate. 29:02.17 James Yeah. so so So like we can, well, cause we committed it, right? 29:02.66 Frank it's Fascinating. 29:05.73 James So then in that instance, you would publish and then merge and do all this stuff. But let's say you had a um a change that you didn't want to commit and you're like oh i want to move it back into the main or whatever. 29:09.86 Frank Hmm. 29:16.58 James You can just move it around from work tree to work tree. We committed the code, so then like the code's in that branch. 29:20.29 Frank OK. 29:23.15 Frank OK. 29:23.11 James so I think in that instance, you would just merge the branch back in like you're saying. 29:27.77 Frank Right, right, OK. 29:28.10 James You'd publish it, merge it, it would work. 29:28.65 Frank I'm not going to do that because i don't actually want a James-approved commit into my main. 29:32.54 James Correct. 29:33.33 Frank But yeah. 29:33.29 James Correct. Yeah. So it, so the migrate changes, like you to say, I have these change, haven't committed them, but just like, I want to put them back into my main now so you can move them over without having to commit them to get, because work trees are going to kind of just throw away anyways. 29:34.89 Frank i 29:45.85 James so if you're just like, Hey, I have all these changes. 29:46.30 Frank Hmm. 29:47.09 James I tested them, push them on over basically. Does that make sense? 29:51.77 Frank It does. um And especially because it looks like even the head file for the work tree points back to the main ref heads, James. 29:52.69 James Yeah. 30:04.36 Frank So I think all the merging stuff's just going to work. 30:04.34 James Mm-hmm. 30:07.32 Frank Without me actually doing it, just chasing around git pointers, it looks like. 30:07.70 James Yep. Doing that. 30:12.76 Frank It would do exactly as we would expect, yeah. 30:14.81 James Do that stuff. Yeah. So if you didn't want to go through the thing where like, oh, I'm merging, I'm doing this stuff. 30:16.16 Frank Mm-hmm. 30:18.93 James I'm on my machine. I'm like, I got these changes. They're looking good. Let me just put it, especially when you're working off a branch. So for example, you're working off a branch, you have design. So you might, so in this instance, you're like, hey i have, I have, for example, you know, redesign every design one, two, three. 30:34.14 James why Why go through the process of committing, merging into the branch, which is just going to be merged again into the branch. You just say, take all my changes that I have, move them over here, x Y, Z, handle merge conflicts, do a thing. So that works out pretty nice. 30:48.33 James Yeah. Without having to commit any code. So you can basically say all my changes that are uncommitted right now, move them from one of the work trees back into, you know, a branch without having to commit. 31:02.52 Frank Yeah. And I'm starting to get a feel for this. like um I was going to say before when we were we were first starting out that like um a pro tip, if you need to get clone something, you don't always have to point at the remote.git file because then you have to download it all from the internet again. 31:06.26 James Yeah. Yeah. Mm. 31:22.49 Frank If you're ever cloning, pro tip, you can reference a local.git file and just clone from that.git. And it feels like this is doing basically that. 31:32.66 Frank with the added benefit that it's sharing the object database. And obviously now it's sharing the refs database also. And that's that's kind of the freaky part. 31:43.21 Frank Because usually when you have two different.gits, you have two different sets of.refs or slash refs. um So this is this you could definitely shoot yourself in the foot with. 31:49.26 James Yeah. 31:53.62 Frank But it's also obviously very powerful. 31:56.92 James It's a little, it can get a little funky to kind of wrap your head around it, but why is this important? Well, Frank, you've updated your VS code in the last two days. 32:04.82 Frank I believe. i believe. Every time I start getting a bunch of tweets about get doing something, I'm like, God, is there an update? And then I do the update. 32:12.28 James Okay. So, um open up your Github Copilot chat. 32:17.17 Frank Oh, you're going to? I have to restart to update. It's going to happen. 32:19.99 James Okay. Restart to update. 32:20.73 Frank ah ah Yeah, yeah. 32:20.90 James It's going to be quick. It's going to be quick on here. So, so the reason you're like, I'm thinking about this before is, you know, how often am I doing this and why is, why our work trees important? 32:31.94 Frank Mm-hmm. 32:31.99 James And the answer is, It's been a nuisance to do what we just talked about, but because we didn't really need work trees, we're doing it very rarely. However, in the world of a i you are spinning up many experiments. 32:45.93 James You're spinning up a whole bunch of ideas and you have an idea and you just want to fire it off and let it do its thing and check it out on your local machine. 32:47.03 Frank Fair enough. 32:52.76 Frank Right. 32:52.92 James And you have to wait around, right? 32:56.84 Frank Don't want to be cloning. i mean i mean, you could. So the alternative is you clone, clone, clone, clone. 32:59.38 James You could. 33:01.68 Frank So this is just a more efficient cloning technique in that regard. 33:05.02 James Correct. 33:06.04 Frank Okay. 33:06.42 James Well, and imagine that you have an agent like Copilot that's like, Hey, let me go work on this in the background. And imagine if i had to clone the entire repository before it could get to work again, into a new folder that you specified with a new branch. 33:17.24 Frank Right. Yeah. 33:21.30 Frank hu 33:21.63 James Instead, it could leverage work trees. 33:25.91 Frank And if you're a nut like me, I do all my Git work under a Dropbox folder. Insert your favorite document sharing service here. 33:31.65 James Hmm. 33:33.94 James Wild. 33:35.58 Frank ah It's kind of nice because then you have two backups of everything. i Just saying. Two history recorders. If I really mess up one, the other one can be kicked in. um What's nice here is when I did my old um do two clones of the same repo thing, there were a lot of duplicate files, especially for an old project because the object database, basically. 33:52.01 James Yeah. 33:55.57 Frank um this doesn't have that issue. ah It's sharing the object database. So it's actually very lightweight for my Dropbox. Like um probably should turn off my Dropbox when we're recording podcasts. 34:08.26 Frank And yet here I am verifying like the Dropbox is all caught up and everything because it has very few files to sync because it really just did a bunch of copies of a few files and then it's just the ref files. 34:14.56 James That's true. Yep. 34:19.62 Frank And there's actually no ref files here. 34:20.22 James Yep. 34:22.12 Frank Basically, it's just a couple. 34:22.74 James easy now. 34:23.73 Frank Yeah, so this is very lightweight. 34:24.41 James Okay. VS code open. 34:26.31 Frank VS Code open. Do you want me in the work tree or the main tree? 34:30.42 James Uh, it died. Don't, it doesn't even matter. Just main tree. 34:32.92 Frank Oh, OK, yeah, okay 34:33.27 James Okay. 34:35.06 Frank ah What do you want me to do, James? 34:37.43 James okay Open up the getup co-pilot chat. 34:40.08 Frank Uh-huh. It's always open. 34:40.77 James Okay. 34:41.30 Frank Come on, 34:42.13 James It's always open. Okay. Do you see the plus button? Then you see a little chef. 34:47.55 Frank There's chefs everywhere. um Yes, plus new chat, new chat editor, new chat window. 34:53.34 James New background agent? 34:55.38 Frank No. Do I have to restart to update again? Oh, I do. 35:00.53 James don't think so. 35:01.36 Frank That's hilarious. 35:01.73 James Oh. 35:02.16 Frank I was too behind. ah One moment, please, James, while we restart to update. 35:05.21 James Wow. Frank, you you must you must you must close your Code. 35:12.34 Frank Oh boy, did we get background agents? I feel like, oh my God, there's so many options now. New chat, new chat editor, new chat window. Those are classic. New background agent, new clued agent, cloud. 35:25.85 Frank Sorry for my pronunciation. 35:26.85 James Not Claude, but Claude. 35:27.01 Frank New codex agent. Excuse me, who are you, codex? ah but I don't know. 35:32.35 James OpenAI Codex. 35:33.65 Frank I'm lousy with agents here, man. Which which agent do I want? 35:35.70 James OK. So let me define what these agents are. Actually, Kyle, the CEO of GitHub, did a great video that we'll link to in the show notes on the VS Code one that breaks it down. You basically have three types of agents. You have local agents and you have cloud agents. Now, local agents can run in one of two ways. 35:52.73 James A local agent can be in the foreground, which is what we're used to. You type into a chat and it does stuff look yeah like in the foreground. You're waiting for it to complete, right? a back and Locally on your machine. 36:05.43 James A background agent can work locally on your machine, but in the background. And it is just off doing a thing, kind of like a CLI that's hidden, if you will. In fact, it's powered by the CLI. 36:16.44 James Okay. You don't even have to the CLI it's included in the thing it's there. So that's pretty easy. So local and cloud local can be foreground can be background pretty easy. 36:27.51 James Now, the interesting part is that, um, the foreground and background agents can work on the branch that you're working on or another branch that you create or on a work tree. And they can even create a work tree so you can be working as well. 36:45.78 James So what important about this is Frank could be working on something, a bug report comes in. He's like, oh my God. And then what he does, he says, let me create a new background agent. put it on a work tree, go and do it and fix the bug. And it goes off and does it. 36:58.78 James Now a cloud agent obviously is the third option. That is an agent that's running in the cloud completely asynchronously, not on your machine. That is a GitHub cloud agent, which I use all the time. Right. 37:09.72 James And then codex is also a foreground local agent, but it's powered by open AI codex extension, but you're logging in through with your GitHub copilot subscription. 37:23.00 James So you don't have to have an open AI account to use codex, the extension, just use your sweet premium requests. 37:31.32 James You sign in with copilot, like, you know, you sign in with Twitter, you sign in with copilot and you use codex. 37:31.59 Frank Okay. 37:38.74 James So open AI bills, get hub, you, you pay GitHub. So it's one less subscription. Okay. So 37:47.06 Frank You had me all the way up to Codex. 37:47.45 James do 37:48.38 Frank I totally don't get what the Codex one is, but fine. 37:50.04 James So, so, so, so that one, you're not using the co-pilot UI you're using the codex UI. So the codex extension. 37:57.14 Frank Oh, okay. 37:57.94 James Yeah. 37:58.50 Frank That makes a lot more. Okay. Oh, Sama. Always trying to reinvent the wheel. 38:02.61 James Yep. You remember when Xamarin was both a company and a product. 38:03.35 Frank Got it. 38:06.62 Frank but 38:06.84 James Okay. Problem. So codex, both an extension and also the name and model. Very confusing. 38:13.66 Frank Got it. 38:13.75 James Yes. 38:14.22 Frank Thank you. 38:14.58 James Yeah. 38:15.02 Frank Okay. 38:15.48 James Very confusing. 38:15.98 Frank I'm never going to touch that. 38:16.24 James Okay. 38:17.06 Frank Thank you. 38:17.59 James new New background agent. 38:20.94 Frank Let's do this. 38:21.34 James Click it. 38:22.30 Frank Okay. New background agent. 38:25.05 James On the bottom, pick a model of your choice. 38:29.32 Frank Uh, done? 38:32.47 James Now, notice Codex, 5.1 Codex. 38:32.82 Frank Can I pick codex? ha 38:37.03 James I've been, I've been five, five X codexing now. Uh, notice that. So, so interestingly, those ones that are available, there are different than your main ones. Cause those are the models that are available in the GitHub copilot CLI, which powers background agents. 38:46.94 Frank They are. 38:53.62 James Okay. 38:54.20 Frank Right, this is background. Right. 38:55.25 James Yep. 38:55.60 Frank And sorry, can you repeat one more time? 38:55.83 James Background. 38:57.56 Frank is background still local on my machine, though? So if I were to pull the plug on my machine, background's going to stop. 39:03.33 James Yep. That is correct. That is correct. You have local and cloud and local can run in the foreground or in the background and cloud runs in the cloud. in ziclude Um, okay. 39:16.61 Frank OK. 39:16.66 James You picked a model. Notice the next, the next thing is work tree or workspace and work tree is the default. 39:18.10 Frank Done. 39:20.95 Frank Work tree. Oh, God, why did they have to name them the same thing? Okay, fine. WorkTree, WorkSpace. Got it. 39:28.47 James Workspace is your current workspace, basically whatever branch you have open. So you can say work sharing and say, let's update this. Read me with emoji. Why not? 39:41.17 Frank I'm going to add more emoji to my autopilot rudder control system, which it really does not need emoji. 39:48.12 James Perfect. 39:50.48 Frank But James, that is your example. That's what I'm doing. 39:54.30 James Fire it off. 39:55.96 Frank Created isolated work tree. Oh, God, another work tree. 40:00.24 James So now you have a work tree called work tree 2025 dash 12 dash whatever. 40:04.21 Frank yeah It's true. It's true, I do. 40:06.00 James Yeah. It's in the future. 40:07.06 Frank Where is it, though? 40:07.38 James Cause it's UTC. 40:07.82 Frank Because I'm still on my James. 40:08.36 James Yep. 40:09.14 Frank Oh, no. i'm know where I am, James. where Where am I? Where am I? um i am going back to my main thing. OK, there is indeed a new work tree. 40:21.23 James yep So if you, now, when you go to your source tree, you'll have the James work tree and the work tree with a super long name, and then you can check out that work tree branch. 40:21.34 Frank Name that. 40:27.19 Frank Which it also created branch with that same long name. 40:31.48 James Yeah. 40:32.09 Frank So it seems like work trees and branches, they're really kind of merging them a lot. But yeah, it's cool. 40:36.73 James Yeah, I feel like the, think what's nice is really like, Hey, I'm in the James work tree and James is the default branch. 40:36.80 Frank It's cool. 40:44.17 James That's kind of what it is. 40:44.76 Frank her 40:46.07 James I think that way it's like main and master like aren't this the same basically. 40:49.27 Frank Oh, fascinating. 40:49.47 James Yeah. 40:50.11 Frank Even though I created a background, though, it doesn't want me to close the window. Fascinating. 40:54.73 James Oh, you can, it'd be fine. It'll just like warn you. It's fine. It'll just keep doing it. 40:57.59 Frank Oh, it's complaining, but you're saying it's fine, huh? It says the chat request will stop if you close the window. 41:02.81 James I think it's going to be okay. 41:05.03 Frank I'm not doing it. Too risky. 41:06.35 James Yeah. 41:07.51 Frank Bold move, Cotton. 41:07.51 James Well, you can hit the little back arrow. You you can hit the little back arrow and and it'll show you all of your sessions now. 41:15.54 Frank Back arrow? What back arrow are you talking about? 41:16.73 James Yeah. and Inside your chat agents. See there's a little back arrow in the chat up top. 41:24.01 Frank Nope. 41:25.24 James Under chat, under the word chat, there's a little back arrow. 41:29.77 Frank Is there... 41:31.10 James my Mine, mine already was already done. It was know time at all. 41:34.46 Frank Yeah, you have a good internet. um Yes, you are right. There indeed was a back arrow. A left-leaning arrow, as we like to say. 41:40.82 James So you can go back to all of your session. Now you can go back to all of your sessions. You can see all of your sessions that are there. 41:46.97 Frank Okay, yeah. 41:47.61 James Okay. Now here's, what's interesting. So let's say you're in just a local chat and now. 41:51.42 Frank Oh, James, what is it? It's added so many emojis. 41:55.13 James Good as it should have. 41:55.54 Frank This is all your fault. 41:57.26 James Yeah. So you can actually like, well, here's, what's cool is like, you can actually go in and you can view the diff and all this stuff that's there and, and see everything, you know, no matter where you're at, basically. Yeah. 42:09.73 Frank Oh my goodness. James, there's emojis everywhere. 42:11.32 James All the emoji. Yeah. 42:13.78 Frank What did you do? 42:14.04 James Good. 42:14.46 Frank what that That was the worst example you could have possibly thought of. 42:14.88 James Good. 42:17.17 James You're, you're in the work tree. You're in the work tree. Okay. You're in the work tree. It's fine. 42:21.17 Frank Oh no, I'm committing right now. Upload, push. 42:23.10 James Okay. So the cool thing is, is that you can do a few things, Frank, so you can obviously keep working on that background one. That's there. 42:33.72 James Now let's say you're in a normal chat. 42:34.05 Frank Yeah. 42:35.04 James So let's say just create a new chat, new, new chat, go up there. New chat. 42:39.64 Frank You are a gutsy gutsy guy. 42:42.06 James It's new chat. 42:42.20 Frank New chat. 42:42.78 James They're all, they're all fine. It's all running. 42:44.82 Frank In my work tree, in my main window, in my James. 42:44.82 James Okay. In your main window. 42:47.38 Frank Like, I have so many copies of my code now. 42:50.29 James Doesn't matter anywhere. 42:52.75 Frank OK. 42:53.37 James You're you're yeah. 42:54.10 Frank um I'm here, babe. 42:55.48 James So then you have a chat box down there, right? 42:58.25 Frank Mm-hmm. 42:58.36 James So you could say at CLI or at cloud. Right. 43:01.95 Frank OK. 43:04.02 James And then you could, you could delegate something there. 43:04.42 Frank Yep. 43:06.23 James But you could also type type something and you could say, you know, do something else. Right. And then notice that you have a agent, you have a model, you have tools, you might have a microphone. You have now kind of two send buttons. Yeah. There's like two send buttons down there on the right. 43:22.92 James little funky. 43:23.23 Frank Kind of is, yeah. one One's a continue chat in and there's a send. 43:24.84 James Yeah. 43:27.34 James Yeah. Ascend. 43:29.61 Frank Yeah. 43:29.75 James So do the continue chat in. 43:32.50 Frank Oh, boy. 43:32.66 James This is a few things that are interesting here is you might be working and have a bunch of files that are like checked out already that you've been working on. 43:35.96 Frank Hmm. 43:41.49 James You're like, you know what? i don't got time to finish this. You might want to delegate to the cloud or work in the background. You can take anything in a current chat session or just a new status, Jessen, and just say, continue in and say background. 43:52.06 James And it will take all of your current changes, move them into a new background work tree, and just get to work on your behalf automatically or move it to the cloud. 44:00.49 Frank Can I tell you why I like this, James? 44:02.42 James Why do you like this, Frank? 44:04.28 Frank Because i have had been having one of those bad internet days where it feels like every every um every chat I try to have with the AI, it's like network error. 44:15.86 Frank And then you might try something else. Network error. Network error. Network error. I'm having a bad internet day. So I feel like if if I had done update to restart, restart to update earlier, i might have discovered that I could just move the whole gosh darn thing up into the canood and just have it go there. Because I'm assuming in the clouds, the internet is always good up in the cloud. So I kind of wish you had told me about this about five hours ago. 44:42.78 Frank Because I'm going to use the heck out of this whenever I'm having a bad internet day. I am going straight to the canood. 44:50.33 James Good. Yeah. that ah that 44:51.26 Frank Is that what it's for? Am I using it wrong? 44:53.72 James No, that's correct. Yeah. I mean, I use, I use, uh, so something I do for cloud agents specifically is, I have to get a mobile app on my phone. 44:55.26 Frank right 45:04.45 Frank Right. 45:05.34 James I just open my, my repo and I can, there's a new task for the cloud agent and you just tell it what you want it to do. 45:10.13 Frank Yeah. 45:11.98 James And it just goes and creates a pull request for you, opens it up and then just goes to town and works off whatever branch you want it to do. Right. Boom. Just does it. 45:19.86 Frank Right. Yeah. 45:20.98 James Um, so one thing I do at the end of the day, every day is I assign something to copilot. I just give it to it. So I go into VS code, i either spin up a new task for it to do, or I go on to get up.com or my mobile app, spin it up. 45:26.42 Frank no 45:31.71 James And often before I go to bed, I also do that. So I'm always just spinning up stuff automatically. 45:34.62 Frank Nice. Yeah. 45:37.56 James just because I can, why not? Um, yeah. Or like in this case, you can just say, you know what? 45:40.95 Frank But I like... 45:43.67 James I have this feature. don't know, whatever, spin it up, put in the background, let the cloud take, take it and handle it later and just go to town. 45:50.36 Frank Yeah. Yeah. 45:50.75 James It does, it takes more time, right? Cause it has time to do stuff, but the results are pretty better. Hmm. 45:55.86 Frank So I know we're mostly talking about work trees. So I'll ask the obvious question. When I do a cloud one, is it by default going to do a work tree stuff? Or no, that's pretty explicit, I have to say. In that second dropdown, as you explained earlier, you have to choose work tree when doing a background one or whatever. 46:10.07 James For, for clouds, you can actually spin up a new cloud agent specifically, and there's actually no selections in there. So you are just giving it to it. 46:17.56 Frank Right. 46:18.99 James It will work off the current branch that you're on. 46:22.64 Frank OK, fair enough. 46:23.28 James Yeah. 46:23.74 Frank Yep. 46:24.31 James So if you're on main, it'll be off of main. 46:24.50 Frank so 46:27.67 Frank So if I do a cloud one, it will eventually synchronize with the editor at some point then. 46:30.65 James Just a branch it creates a branch. 46:33.99 Frank Mm-hmm. 46:34.33 James It will. Okay. So just go in to your main and just say, Hey, update the read me with a bunch of emoji and fire it off to the cloud agent. 46:41.29 Frank Oh, man. No, not more emoji, James. No. 46:44.57 James Yeah. Do it. 46:45.61 Frank Those poor repos are already in such trashed state. 46:48.18 James It they're all in branches and work trees. 46:49.07 Frank It's so trashed. 46:50.54 James They're all throwaways. 46:52.73 Frank I care a lot about my code. 46:54.60 James I'll burn a premium request. 46:54.69 Frank All right. 46:55.66 James Let's do it. Come on. 46:56.54 Frank All right, I'm doing it I'm doing it I'm doing it. 46:58.37 James Yep. Yep. 46:59.02 Frank I'm trying to find my readme because I have so many junk files in here. 47:01.56 James No, you don't even need to tell it. Just tell it. Tell it to update the README. 47:03.80 Frank OK, please, please update my readme. 47:04.44 James Just tell it. It knows. It'll find it. That's sweet emoji. 47:10.92 Frank Readme with sweet emoji. 47:15.24 James Yep. Fire it off to the cloud, baby. You don't you don't need to. That's going to spin up on entire environment. 47:20.12 Frank What tree is it going to work in? Which work tree? Which branch? Who knows? Let's just go. okay it's actually going to ask me. 47:25.78 James Yep. 47:26.58 Frank Delegate to the cloud. Cloud agent. Blah, blah, blah. um This workspace has uncommitted changes. should Speak of the devil. Should these changes be pushed and included in the cloud agent's work? 47:38.64 Frank No, it should not. 47:39.61 James No. 47:41.14 Frank And my options are commit changes and delegate. Delegate or cancel. just going hit delegate. 47:47.45 James Delegate it. 47:48.73 Frank ah ah Repo base branch is not detected on remote. That's because this isn't up on a remote. Okay, fair enough. 47:56.06 James Yes. 47:56.41 Frank So you want to be, you actually have to be synced to a remote to use the clued. 47:58.46 James On your main. 48:03.26 James Yes. 48:03.58 Frank That makes sense. 48:03.74 James Okay. So go to your main and then just tell to go do the same thing. 48:07.89 Frank Sure, fine. 48:09.34 James We got to do it in real time, Frank. 48:09.62 Frank my My poor source code. It's never going to survive any of this. 48:14.91 James It'll be fine. You don't need to merge it into Maine. Fine. 48:18.33 Frank You just assume that I push everything up to the cloud. i get i get without the cloud sometimes, you know. That's how I roll. Please add some sweet emojis to my readme. 48:31.22 James I hope it's all sweet, like treats and stuff like that. You know what i mean? 48:34.04 Frank Oh, God, it is going to do that, isn't it? 48:36.25 James I think so. 48:36.34 Frank Well, too late now. i hit enter. 48:39.83 James God. 48:41.31 Frank It's creating a pull request. Okay, so that's the that's the world we're living in. 48:43.16 James It is. 48:45.19 Frank Got it. 48:45.30 James Yeah, so when you do a cloud agent, it's going to create a new branch off of your branch that you're on. And like you said, you were on the work street before, which wasn't pushed up to the cloud, so it doesn't know what to do. It maybe should fail faster, in my personal opinion, but probably whatever the APIs are calling is there. So there's there's this that you can go and do. Now, inside of VS Code, under your all sessions, you should now see a new item, and and you'll see that it says cloud. 49:11.96 James Like you see background and cloud and local, you see those items there. 49:18.36 Frank Um, it does, yes. Okay, yes. Cloud, right. Okay. 49:21.72 James And you can, you, and you can, you can click on it and it will open and tell you what it's doing. 49:22.22 Frank Session is initializing. Okay. 49:30.23 Frank Cloud Agent has begun work. It's on a coffee break at the moment, and it's demanding rights, but yeah, okay. 49:37.14 James Yeah. It's going to spin up and do some stuff. Yeah. 49:39.16 Frank No, it's cool. 49:39.22 James So now if you, if you go, yeah. 49:40.32 Frank It's working. The poor thing is, oh, it created a plan to add emojis to readme. 49:41.26 James And then, yeah. 49:45.68 Frank I feel, I'm sorry. 49:46.14 James It did. 49:47.08 Frank I'm sorry. I feel like I need to apologize to it. 49:50.30 James Now you can just stop it too if you really want to. Don't do it, but don't and don't do it. It's actually, here's what's really fascinating about what you just did, Frank, is you actually spun up an entire Linux environment where your code was cloned and is now running a GitHub action where I believe that you are the sole cause. 50:03.73 Frank Oh gosh, the poor thing. 50:08.89 Frank Did I just cause global warming, James? Did I do that? 50:12.58 James That is correct, yeah. Yeah. 50:15.67 Frank I'm so sorry, Mother Nature. James made me do it. 50:17.94 James So, So why is this important? This is important because you now have many, many ways of working with agents based on the type of work you need to do. You may not need to use background agents ever, but I find them pretty nifty and pretty fast to do certain things, especially experimenting. 50:38.71 James One of the things that you might think of doing is, you know what? I have this chart. Let's say you're creating a weight tracking application. You have a chart. And you're like, you know what I really want is five different variants or five different styles or five different things. 50:51.79 Frank yeah. 50:52.20 James You could say, go create five branches and five or five work trees to go to this and spin it up. So you spin up five different, you know, background agents that are just getting to work on your local machine, right? 51:03.83 James Um, this is really cool because we've talked about running two foreground local agents before in different parts of the code and that's okay too. Um, but now you can have multiple background agents doing different things. 51:15.45 James And they could be experiments, they could be different different variants, or they could just be different pieces of functionality. You could say, you know what, I want this background agent to go spin up all the back of the APIs, and I'm gonna work on the foreground over here um you know and and do this here. gonna do the mock ones here, or do whatever, and just kind of spin it up. Like you said, work on a bug fix over here and do a feature while it's going. Or more importantly, maybe you're working on a bug and you have an idea for a feature, spin up a new background agent, let's let it get to work. right so 51:45.44 Frank Yeah. 51:45.53 James And just like commits are free, pull requests are free and also work trees are free. So everything's free and you can just throw them right away if you don't want that. So, um, I, and I, and I was just talking to John Lindquist at this AI dev days, and he was talking about critical thinking about how we use these different tools and how we use the CLI. And i was talking about these charts and he's like, you know what? He's like. 52:08.34 James You know, maybe you don't know how to display it, but tell it to come up with 10 unique ways and different styles and different charts and be creative with the data. He's like, you know what? Just tell it to create all 10 charts, put them on the screen, display all the data, and then let you pick about them. 52:21.25 James And then you refactor the code and throw it away. Right. It's like, you have the idea of like. 52:24.52 Frank you 52:26.26 James Different critical ways of thinking with these models that just telling it to do stuff, tell it to come up with different things and display different data and create different. Work trees and you work in the background and different things all the same time. So. Work trees are a core piece of functionality anyone can use, but in integration, especially with background it you know to tasks and agents, it's really fundamental there as well. So that's why it's kind of good to know. I think that the VS Code team or the GitHub team, I've talked to both of them, will put out a very good like video on like what GitHub work trees are that don't take 53 minutes to describe. But I know that Primogen did a video like five years ago on Git work trees. 53:04.28 James And I think it was good, but it didn't really, you know, that was pre AI. So it's kind of like, cool. Get workers are cool. Why would I use this, you know, type of thing. And then now we have like, not just why would I use it? But the tooling is literally helping you create them, use them, spin them up automatically. Like seeing the background agent create that work tree for you automatically. to think about it. Boom. It's right there in the UI. 53:28.12 James Boom. You can bring those over. You can merge it back in bingo bango. You're good to go. So yeah. 53:33.52 Frank Yeah, I've said a lot of things about it all. I'm not going to take any of it back. um I'm not sure if I will use the work trees myself too much, except for in those critical situations, but I can totally see myself using background agents and thus work trees just to keep it all organized. 53:49.79 James Yeah. It's right there. 53:50.89 Frank So I totally see that use case. But I really appreciate the cloud one too, because unlike you, I don't always think to go first into GitHub to do these kinds of things. 54:02.46 Frank So it's nice to just remember that it's it's sitting there behind the little chevron next to the plus sign. And I can always get a cloud one up. 54:09.59 James there 54:10.97 Frank I'm never touching the codex one. I have no idea what that is. um James, I want to report back. This is very important. um It did not put only candy and sweet themed emojis into my readme. 54:22.98 James Wow. 54:23.49 Frank It did flood my readme with emojis, but they are of all sorts, not just candy related. So I'm not sure if it followed my directions explicitly. But I think it understood the gist of what we needed there. 54:35.81 Frank So um honestly, i was going to revert this change. I think I might just keep it. There's a lot of emojis. 54:45.77 James Means you're doing something right. So yeah. 54:47.45 Frank ah Terrible. Absolutely terrible. 54:49.87 James Yeah. Yeah. 54:51.42 Frank These are cool features. I'm really glad you introduced them to me, and I can't believe it took me 10 years to learn what sounds like a pretty major Git feature. So thank you for the intro to Git lesson today also. 55:03.80 James You are very welcome. I'm glad I could teach you something, but I also just found out about them this year. So no shade on anyone that's just learning about work trees for the first time. However, because of this new VS code release and background and these things going in there, I think there is a pretty nice, large education to be had on them. 55:21.11 James And don't even know if I did the best job. 55:21.40 Frank Mm-hmm. 55:22.35 James So let us know if we got this right, wrongly comments on youtube.com. At merge conflict FM. That is us. If you're there, then you're already watching us. so you should definitely subscribe. Like, if you're listening, you can also do that because you're probably also listening to your podcast app. So make sure you also hit that subscribe button and share with your friends and coworkers. That's to it for this week's Merge Conflict. Let's go ahead and get our work tree spinning. So until next time, I'm James Montemagno. 55:48.76 Frank And I'm Frank Kruger. Thanks for watching and listening. 55:52.06 James Peace.