Transcript#
This transcript was generated automatically and may contain errors.
Hello, everybody. Welcome to the Data Science Lab. My name is Libby Herron. I'm a Data Community Manager here at Posit. I'm joined by Isabella Velazquez, my co-host today, and your maven on Discord. Isabella, would you like to say hello? Hi, everyone. Thanks so much for joining us.
We're so glad you're here. And we are joined by our lab manager for today, Barret Schloerke. Barret, would you like to introduce yourself? Hello, my name is Barret Schloerke. I am on the Shiny team at Posit. And yeah, just discovered Worktrees, you know, a few months ago and haven't looked back. So I want to share with everyone all that I know. Yay, that's what we're all about.
Okay, if you've never been to the Data Science Lab, we get together every Tuesday, same time, same place, most Tuesdays. Sometimes we take breaks and sometimes there's holidays. But we are here to do exactly what Barret just said, to share knowledge, to talk about technical content. And this is a place where we do not have a bunch of slides and just talking and lecturing and presentations. This is more about screen sharing and hopefully doing a little bit of like exploring and paracoding with your friends on the internet, your data friends on the internet.
Today, we are going to be talking about Git Worktrees, which is a concept that did not come into my brain until, same as Barret, a few months ago. Isabella and I were working on the Data Science Lab episode that we did for Git and GitHub integrations in Positron, which was very, very fun and super, super great. I think a lot of people had fun with that one. So look for that one on YouTube. But inside of our exploration in Positron, I remember I kept seeing work trees over and over again. And I'm like, what the heck is a work tree? And then I noticed more people talking about it. You know, when you hear a word or you see a word, you learn a word, and then you see it everywhere.
That started happening with work trees. And then a lot of people in the lab started asking about them. What is a work tree? So Barret is here to talk about them. Barret, I am going to give a brief explanation, and I'm going to let you take it away with some demonstrations of what I am talking about.
What are worktrees?
If you have never explored work trees before, and some of us have, like I know James here has used work trees before. We've talked about that. Work trees allow you to basically check out two different Git branches at the same time locally. So usually with Git, you check out a branch, and you have a view of your project, right? You have a view of all of your folders inside of your project. And you can make changes, commit them. But if you haven't really like finished what you're doing, you sort of have to like stash your changes or commit it temporarily. And then you can go check out a different branch and do other things. This allows you to check out two different branches at the same time locally, which you can switch between, but they are visible to you in a folder structure. So each version of your project basically is in a different folder.
Have I blown anybody's mind yet? A little bit. Okay. I would like to reiterate that that is the main explanation. It allows you to check out more than one branch at the same time. They have to be different branches. They of course cannot be two versions of the same branch that would create a local conflict that would not work, and then the universe would implode. So that doesn't work. They have to be different branches. I'm going to let Barrett take it away. What did I miss from there? Because that's a simplified explanation, but I don't want anybody to be like afraid of the topic. No, that's good job, Libby. The gist? That's the gist. Yeah. Okay.
Exactly that. So yeah, I will reiterate, WorkTrees are, it's as close to a full clone to a new repo. So that, except the only thing with WorkTrees is that they try to make it a, it's not done ad hoc. You're not just willy-nilly checking out, cloning your repo into different folders. It's a organized way to do so. And there's ways to do it on command and also to clean it up. And cleaning it up is important because you don't want just clones existing forever and ever and ever. Because it's your whole project, right? Like it's like, this is the whole repo. Clone of your repo. So if you have a very, very large repo, imagine the memory, the local memory that would be taken up by just like cloning your project over and over again. So just like when you want to delete your local branches, it's important to delete your local WorkTrees, right? When you're done.
Even more important. I think branches feel more like diffs. So it's just little alterations where WorkTrees on your hard drive, it's physically two full copies.
Yes. So instead of in the mental model of branches, where a branch is only storing what has changed, right? Because it's like, I'm only going to look at what's changed. Everything else is the same. We're going to leave it. We're only going to store the diffs, which is what you are seeing when you're looking, you're looking at the differences. But with WorkTrees, it is like, we're going to bake you a whole nother cake. You have a whole extra thing that you are storing.
we're going to bake you a whole nother cake. You have a whole extra thing that you are storing.
I think that's a really, really important thing to remember. And I saw on, I want to say BlueSky this morning or last night, Carlos, who is also at Posit talking about how he had filled up an entire two terabyte hard drive or something with WorkTrees. I think they can add up very quickly if you're doing a lot of things at one time.
So Barrett, when is understanding and using WorkTrees important and valuable? Because I've never used it before or needed it before. Obviously, I haven't hit that use case. But the way that a lot of people are working every day, especially using AI agents, is changing what people need.
Replacing git checkout with worktrees
Yes. So short answer is, whenever you would say, you know, get checkout, make new branch, whatever incantation you wanted to do, I've replaced that completely with make new WorkTree. And this has removed my need to know about stashing or like committing temporarily. I don't need to do all of these little workarounds to get my job done. And I think it's really beneficial because like, you could be two days into a feature and then your boss or, you know, CI comes back and says, you need to fix this now. And like, it's so disrupting to try to figure out like, how do I pause this to go over here? And instead with WorkTrees, it's like, all right, from main branch, make new WorkTree. And it's in a different folder. So you can have, you know, kind of how when you have your RStudio IDE or Positron, you have like your unsaved files, and they just magically reopen when you open up your project again. It's like having that with WorkTrees, you could have your unsaved changes. And it's separate, it's different. And it works out well that way. And so anytime that I would say git, you would have a git checkout to start a new feature. Instead, we should create a new WorkTree. And then we can do our work in parallel that way.
Okay. And I think it's important to say that this type of working will not be for everybody. There will be a lot of teams who are just like, we're going to keep doing exactly what we're doing. We don't have a need for WorkTrees. This is a place where we can just be in receive mode and learn about this stuff, even if we don't need to directly apply it right now. And learn about new possibilities and new ways of working that we could maybe adopt and adapt to what we need to do.
So Barrett, I would love it if you would be able to share your screen and let's talk a little bit about what this actually looks like in practice. So we're talking about WorkTrees on a basic level right now. But Barrett is also going to show us the sort of next Pokemon evolution of that, which is orchestrated WorkTrees, which is a WorkTree first way of working. He uses a tool called Conductor. And I will let him explain a little bit more about what Conductor is, because I think that it's going to be a little bit of another level of brain expansion.
Before we get there, let's ask one of our questions that I saw James ask that says, can you have a sparse WorkTree? And I'm not 100% sure what James means by this, but I'm guessing it's a memory saving sort of concept here. Unfortunately, James, I believe branches are going to be your model for sparsity. And that they only have the diff where in WorkTrees, it's physically full file copies. They're not soft-linked or sim-linked. It's full copies. So no sparseness.
Introducing Conductor
All right. Let's do it. I love Daniel put the spiderverse of GIF of the spiderverse in the Discord, which I think is a really great sort of hilarious analogy here where we have a billion Spider-Men. Okay. What are we looking at here? Because I see.
Oh, yeah. So I had, of course, I'm going to ask Claude, because I'm doing agent workflows for everything. And that the way that they kind of explained how WorkTrees kind of shows up is that if you have all of your work being done on a single stove with normal stashing, you need to come in, you need to scrape the pan clean with git stash, you need to add new ingredients by checking out another branch. And then, you know, hopefully you can keep everything straight in your head. Whereas with WorkTrees, you don't need to, like, clean up your stove. Instead, you can just make a new stove and start your new feature or your new fix. And then when you're done with that stove, you can just delete it. So the steak can keep cooking while you make, you know, the rice real quick. And then, you know, when you're done with the rice, you can just delete the stove. And they all will share the same pantry or the same git checkout.
Okay. So let's look at a fun example. So context. This is Conductor. Conductor is a Conductor.build here. It is a Mac only application. There is a I am going to not there's another application called Superset. It achieves the same goals as Conductor. I just have enjoyed Conductor because it's a little more UI heavy instead of where Superset just kind of feels like terminal coordinator. I like a little bit more UI in my applications. But Conductor, it allows you to run a team of coding agents for your Mac. And that sounds very intimidating. But the way I interpret it is that with the click of a single plus button, I can make a brand new work tree with his full file copy and a full everything.
And I can say, hello, add my name to the readme. I'm in a demo. And this will hopefully update the readme with my name.
This sounds like a nice way to teach actually from a real world project because you can be like, well, I don't want to mess my project up by showing all of my learners this stuff. Let me make a demo work tree real quick. I can destroy everything. And it won't touch my actual project. Then I just delete the work tree. Yes. Because Oh, one thing that we did not mention, gosh, I wish we had mentioned it before 16 minutes in was that you you merge just the same way as you would a branch with a PR. So that's how you can sort of resolve your changes that you've made in a work tree into your main project. Yes, exactly. And because it's using the familiar merging, this is why I've switched all of my create branch workflow with no create work tree.
this is why I've switched all of my create branch workflow with no create work tree.
So now I just hit my plus button, and then I'll create a PR in the top right corner for me. And what also might help us understand is Lauren's question in the discord, which is, where does it make this copy? Where does it live? Is it in the same working directory? Is this the right type of like question to even be asking?
Absolutely. It's great. Very important. In general, I went through my settings earlier, just to make sure I wouldn't show you my API keys just by accident. Oh, you're very smart. That would be that'd be bad. They have it in I thought I saw it. It was. All right. Well, if anything, what we can do, there we go. So the root path ends up being this is the repo. And then the workspaces go inside my like a conductor parent folder workspaces. And then every single of my local projects on the left will have their own folder here. And then inside that will be like, kind of like the branch name, but it'll be the work branch or the work tree name. So if I just name your work trees after your branches, but you can call them different things. I've seen people call them the name of the agent that's working on it. I've seen them call them just like fun things.
Yes. So in shiny react, what conductor actually does is by default, they actually open the whole work tree, you have to give it a name, just like a git branch, but they don't know what you're going to work on. And so what they do is they actually make a fake name first. And in this case,
and in this case, always him. In this case, I thought I had it. The name has gone away. Oh, it's Geneva here. So in Geneva, this is actually the one that it opened.
But when we gave it a task right at the beginning, always. When we gave a task right at the beginning, it changed the work tree name to add to read me. Yeah, add name to read me. So what ends up happening is they make a soft link of a folder of add name to read me which points to the Geneva folder, because Geneva doesn't mean anything to me. But this is now useful to me if I were to open this folder inside Positron, or inside Zed VS Code wherever now I can do my normal work there if I want to.
Absolutely. Okay, so I've done some work. Great. And then with Conductor, it is as easy just to say make me a PR. And it'll tell the agent to write up instructions, has a default instructions that it gives. And then thinking about it very quick, hopefully.
Why worktrees matter for agentic workflows
Speaking of hopefully, why we're working trees are useful for me, as well as there will be times where I may send an agent on a task. And it may work for it. It's not it may work. I routinely have 15 to 15 to 45 minute run times that my agent is working. And I don't know when it's going to finish. I don't know, you know, when it's gonna be ready for me to help it. And so it's implementing a long time. I have some co workers where they let it kind of run for like four or five hours, and then they check on in on it in the morning, and they check on it at the end of the day.
And as a background task. Wow, so the work tree is working on in parallel, just the background, and you can do other stuff on other work trees in the meantime. Yes. Yeah. So since I'm twiddling my thumbs for 15, you know, 30 minutes, like, yeah, I not start the same process. And now I can, you know, if I feel like I'm spinning plates, all at the same time, plates that won't crash into each other. This is another thing that somebody brought up on or a few people brought up on blue sky when we were talking about it, was that it creates this sandboxed environment where your agents cannot step on each other's toes.
sandboxed environment where your agents cannot step on each other's toes.
They cannot like bump into each other by and cause a cause conflicts because they're in totally different spaces. And likewise, it can't bump into you or step on your toes. Is that something that you could explain better for me?
Yes, just a second. I don't know why you just switched off your screen and you're probably working on something that you need your brain for. I don't know why my GitHub has decided to log out.
Oh, no, it's, it's all good. I'm, I'm logging in to me every single time. I need to do something. While you're logging in, there are a few questions on the discord.
We totally can. If you have the brain power to open a new work tree in your brain, so we can ask you a question while you're working on that. I saw that Mattan had asked, is RoboRev, which is by Wes McKinney, an example for an alternative to Conductor or does it serve a different purpose? I have no idea what RoboRev is. Do you happen to know Barrett?
Sorry, I'm not sure what RoboRev is. Sorry, it's so funny that it's failed. So, RoboRev is a, as the name kind of hints at, it's a robotic code reviewer. And what its job is, it's trying to do, is that whenever you make a commit, you can do this locally or on GitHub. But whenever you make a commit, RoboRev will insert itself into the process and say, let me code review this right now. Not after you've made 10 commits. Because if I'm, for instance, today I'm using Claude.
Claude will perform 10 tasks, and so it will commit along the way as it's executing its work. And then when it's like, along the way, RoboRev will inject itself saying, hey, I'm a code reviewer, let me work in here, please. And it'll be like, yes, I agree with the decisions you've made so far, you know, continue. Or it will say, oh, linting errors, please fix this. Or I found a security flaw, fix it now, not at stage 10, but at stage 2. So, it tries to catch things and steer things early. I like it. Some colleagues have said that they want to do it more on demand.
They want to do it more on demand, where I am as well. And I will say, like, I like the amount of work that I've done. Please wait until step 10, and then I may invoke it manually.
Community questions
Awesome. All right. Cool. Well, we've got a couple more that maybe we can do really quickly before we keep going. Daniel had asked, I'm trying to tinker with this concept, but can WorkTrees open an orphan branch that is only a subdirectory of the main repo?
A subdirectory, like, for monorepo usage. There is in the FAQ, work in monorepos. I will defer you to the FAQ there, Daniel. Cool. Can you stick that link somewhere that Isabella can get it so she can disseminate that?
You also have the ability to post it in Zoom or anywhere. Awesome. Great. Discord. Okay. So, if anyone doesn't know what a monorepo is, a monorepo is a repo with multiple projects in it, basically. Like, whereas a lot of people would be like, no, no, no, one project per repo. There are some organizations or some teams that, for different reasons, work in a monolithic repo, and you have to have a different way of sort of working inside of it and doing things. And so, that might be the question that Daniel was asking. And then we have one more from Anna that says, hey, so WorkTrees are specifically useful for when you're using an agent workflow, or can they be useful without agents? They can be useful without agents. I think they are more useful by far if you are working in an agentic workflow. Barrett, does that seem right?
Absolutely. Yeah. Okay. When there's this waiting time that you can't control, it's much more useful with agentic workflows. But I would personally just switch all my branch workflows to be WorkTree workflows instead. I think it also benefits you more when you have a robust and large code base. If you have a very, very tiny code base and a very, very tiny project with very, very few possibilities of this multiverse situation, it's probably a little bit less useful, and it might be overkill, right? So, use your critical thinking to determine whether or not it would really be useful for you.
I have also seen people use it for testing. They might sort of A-B test something where they're like, I have two implementations of something on my repo. They're in two different WorkTrees, and I'm going to test each of them for efficiency and for all kinds of different things to see which version I like better and which version works better, and then keep the one that works better. And running tests can take a long time, so you could run them at the same time on different branches.
Back to Conductor: merging and cleanup
Okay. Let's get back to Conductor and a little bit of a practical explanation of what we are seeing on the screen. So, my Git login is off. I don't know why. It is working in the terminal. So, I can just make a new PR, like normal, rather than having Claude try to do it for me, and it would be there. So, I didn't have the agent make it for me, but in the past, I think I've made like under five commit messages or PRs manually in the past six months. I've switched over so hard to having agentic workflows, just because it works for my use case. But I can make a PR, and I could get it merged in. Conductor will tell you that, hey, a draft PR has been open. Here's the PR number. It's ready for review, and we can get that merged.
Let's one thing that we oh, yeah, go ahead, Libby. No, no, I'm trying to tie in some stuff I'm seeing happen in the Discord, because there's a little BS code symbol that's at the top right of your screen, and you have a little ability to open in different things. So, I wanted to just highlight to people that Conductor really is a conductor. It's not an IDE. It is not an IDE. I agree that when I view the file edits or there's a preview of the Markdown, I mean, I appreciate the Markdown preview right there. But it is not a good editor. When I use the edit mode, it's not the nicest syntax highlighting, and so to open it into Positron, you'll need to copy the path, but for VS Code and I believe Cursor and Zed, they have native support, so I can just say open, and now I'm back to VS Code, just like most people will be familiar with, but I'm inside my work tree, and that is the best part. Perfect.
There are, so let's say I got my PR, and I am ready for it to be merged. There is actually a setting that you can do in Git that, let me, where is it, say, rename when it's done, delete branch on archive, and archive on merge. So, one of the things that I really like is that, let's say, I liked my PR, putting my name at the bottom, and it's ready for review. So, let me open it and actually mark it as ready for review, and now back in Conductor, I can say merge.
So, I'm going to do that, and it will actually come through, merge it, I hope, unless, yeah, and now it archived my workspace. The PR was merged, and my workspace was archived, so it auto cleaned up everything for me, given that PR was merged, and now I just can come back and hit plus and move on, and we'll actually see that in the read me at the bottom, authors, all right, it is there, because it bases everything off of origin main to begin with.
So, yeah, it's just, feels very similar to, like, if I didn't tell you this was work trees under the hood, it was just branches, you would feel like you're none the wiser about what's actually happening. Right, because instead of you actually looking at the folder structure separately, when you're using Conductor, it is just like you're in a, you're just checking out different branches.
Use cases beyond software development
Okay, we have a couple of questions, I think will help us understand a little bit better. One is a follow-up from Matan that says, is this workflow, do you think mostly for software development, or could you think of use cases for data science or analysis or something similar? What do you think, Barrett? So, my wife is a data scientist. She's at Sleeper, kind of like FanDuel, and they've been doing some database migrations, and that's been taking three weeks, you know, they're doing multiple PRs of files to be migrated, and definitely should have listened to Michael Chow's DBT talk recently. That would have been very useful, and so this is, you know, a very long process that's happening. You could do this in serial branches or serial, you know, PRs, but also she needs to do some analysis at the same time, and those are going to be three or four day projects that are needing to be happening at the same time.
So, she can come over here and say, okay, I'm going to do this, I'm going to do this, I'm going to do this, and it's going to be happening at the same time. So, she can come over here and say, okay, let's, you know, migrate these files, blah, blah, blah, and then come here and say, do analysis on this data, and now they're separated into different areas, and she doesn't need a stash, she doesn't need to do anything, and when one of the migrations need a hot fix right now, she can go do that immediately. Without having to temporary commit her changes, or stash her stage changes, or any of the things, which is how I generally work, she can just move her focus and then move it back. Move to the stove on the right while the steak is cooking, work on the risotto, and then come back. Absolutely. Okay. What I really want is this left sidebar to be an extra sidebar in all of the IDEs. And this is another one on
the left. This is, it's a hard one, because Positron, and Zed, and VS Code, they look at this folder, and this folder is narrowly scoped to only this folder. It doesn't work for the case of working trees, where I'm saying, I want to belong to, in this case, the Shiny React repo, and within the Shiny React repo, I want 10 different parallel work trees, and I want to switch between them like conversations. And within that conversation, I want a whole VS Code, I want a whole Positron, I want a whole Zed. That's what I want, but that, as Daniel said in the early message, VS Code and friends are not work tree first. They are a follow-up to making a work tree.
Yes, exactly. I think it's a different sort of way of working, way of thinking, way of approaching everything. Okay. We had a question from Nathan that said, I'm wondering if work trees are a way to get around rendering multiple Quarto reports. I tried rendering them in parallel last week, and they all crashed because they tried to write temp files to the same folder.
What an interesting conundrum. Yeah, because the way that Quarto is sort of, what is the word I'm looking for here? Not read, but parsed. Especially inside of something like Positron, it does create temp folders for each of your little cells that you're processing, right?
I think, hopefully I'm not lying about that. Jonathan McPherson is somewhere getting angry that I got that wrong.
It depends on your Quarto documents. If you're checking, if you're able to check in the rendered results, then sure, you can do that. But because if that's the case, I would argue that your documentation is a one-way trip and instead you should have CI render your documentation for you. And so your machine is free from having to do that ever and have CI commit it back to the repo when it's done.
I would argue that your documentation is a one-way trip and instead you should have CI render your documentation for you. And so your machine is free from having to do that ever and have CI commit it back to the repo when it's done.
What is CI? Can you define that for us? CI, oh man, I've forgotten the definition. CI, like continuous integration? There we go. So you might have a CI pipeline. I always try to define acronyms for people because often in data science and in software engineering we just use acronyms like they're the word but we don't explain what they are. Yes, I know, I forgot the definition. Continuous integration, continuous deployment, I think. Yes, exactly. So as let's say it was this one and inside the commits there would be a workflow in GitHub that would come in and say, set up job, check out the repo, run Quarto document, commit results and then it would be done. And then it would commit back to your PR or back to the main branch.
Using worktrees and Conductor
Another question from Anna. Anna, you're asking great questions today, thank you. It says, do you need something like Conductor to work with WorkTrees or can you just use it in your terminal, especially for non-agentic workflows? You do not need Conductor. In fact, you can do it in the UI in Positron which I think somebody probably replied and answered in the discord. Thank you, thank you, whoever you are. Yeah, if you are in Positron, you can go to your little three dots next to your branch and you can click that and go down to WorkTrees to create a WorkTree from the branch that you are on and you can name it. You can also just do command shift P, open up your command palette, type in WorkTrees and you will get your little three options there whether that's create WorkTree, delete WorkTree or migrate, there you go. You can open one. So you can do everything that you need to do in a WorkTree without a Conductor.
But I get the feeling that if you have more than one WorkTree on the go, right? Like you have the need to create many different stoves in your kitchen, it's probably easier to have somebody that you can put in charge of those stoves, right? Yes. And that would be Conductor. I feel like within the Sims, I would have multiple stoves in our Sims kitchen.
Yeah, if you are terminal friendly and you want to use the commands, there are full commands within the terminal for setting up WorkTrees. Perfect. Should feel fairly native. Would you be willing to pop that link into the Discord or somewhere? Amazing, amazing, thank you.
Okay, Discord. If I have missed your question, please put it back in the chat or just like forward it to the same chat something so that we see it, okay?
All right. And thank you to everybody who's answering questions. Not all of the questions that get asked even need to be asked to bear it because sometimes they are just answered by the wonderfully useful and helpful people in the chat. Thank you so much. You're the best.
All right, perfect. Barrett has shared that link to the docs in the chat.
Reverting changes and worktree naming
All right, you have just asked it to revert your most recent changes. Oh yeah, I was putting my name in the readme. How does that work? How do reversions work? In this case, because it is checked into main, it will just be a new commit. But it's, yeah, it's removed the author section that added my name.
Okay. I'm trying to figure out, I'm trying to wrap my brain around this because you're in Memphis. What is Memphis? Like I'm having such a hard time, I guess, conceptualizing these names, the names of the different things on the left. Because some of them are names, some of them are pointers to names. They have, where is it? It's projects, history, no. Let me do this one quick. Let me quit and conductor. There's something with conductor where they have a mini game of, if you open up enough work trees, they didn't have it right away. But if you open up enough work trees that it will, yeah, 74 of 307 cities visited. And not all cities have the same proportion, but it's like, oh, I was just in Memphis. Okay, well, somewhere over here, I visited Memphis. Like, ta-da. So it's picking city names to name your work trees. Work trees, yeah. Okay. Just to have fun.
I needed a little bit of context around why that was happening or what that was. It needs that temp name to make the work tree. And then once work has been started, it makes a new name that points back to that temporary folder so that it doesn't have two checkouts. Yeah. Yeah, so that's what it does. Because like a git branch checkout, you need a name to check out into first. And so since it doesn't know what you want to do, it just kind of makes a fun city name.
Memory, archiving, and managing worktrees
Okay. James has also asked a question that I want to know the answer to, which is, is Conductor measuring current RAM usage up in the upper left? Yeah, that's experimental.
Is there a good way to keep track of how much memory you are filling up with all of these things you're creating? And like, when do you know it's time to delete them? Do you, do they, you have that set so that they archive upon merge, right? So like you do a PR, you do a pull request, you merge into your main branch, and then it archives them. Does that mean that it is no longer taking up space, that it's minimizing them in some way? Or do you still need to go manually delete them? It, I think, will delete it after 30 or 90 days if it's just archived, kind of like Gmail does with your trash. It doesn't get rid of it right away. But you can, in the settings, set that delete branch on archive. And if you delete branch on archive and you enable this one, it will make it so that when you archive, it is gone, gone. It's not archive, it's delete. Basically archive equals equals delete at that point. At that point, yeah.
Do you ever go back to ones that you've archived and reopen them? I have. And that's why I do not have that one checked anymore. There was, where was it? Oh, history. There we go. So I think we added this one. And if I move Zoom, this was the one that I added my name in the readme. And we can see that the PR is merged. But if I come back, we have the full chat for telling me that I couldn't do my login anymore. And it's all there, just as if we never left. And so that's why I like that archive. And then, you know, my attention spans, if I'm not back to it in 30 days, I don't need it, so. Right, yeah. And it's kind of like, if you haven't worn something in your closet in a year, do you really need to own it? No.
So we'll go back to archive. I'm checking the chat, everybody, to see if I've missed anything. Bear with me for two seconds here. Isabella, also feel free to bust in like the Kool-Aid man and tell me if I've missed something.
I did want to go up and highlight, because Garrick showed up in the chat. Hey, Garrick. And kind of gave a deeper explanation to Daniel's question about orphan branches, or orphan subfolders, or maybe. Oh, I feel like I'm missing it. Here it is, okay. So he said, work trees are a great way to interact with orphan branches. For example, GitHub pages branches, branches that are part of the repo, but don't have all of the commit history or any of the files that are in other branches, like your main branch. They're a great way to store rendered docs or other static assets in the repo without cluttering your main branches. Thank you, Garrick, for the extra explanation. We appreciate you.
Mac tips and Windows alternatives
Okay. What other questions do you have? There was another question that was from James about what is the little red, yellow, green in the upper left. That is just a Mac thing. That is like close the windows red, minimize it as yellow, and then maximize it as green. But that also changes if you hit the option key. So like if Barrett hit the option key, those would all change their options, their symbols. Did you not know that? No. Heck yeah. Green actually defaults to full screen, which drives me bonkers. So if I hit the option button, the green turns into just make bigger, just maximize into the space you have without becoming full screen. And I really like that.
So some tricks that are Work 3 independent, I have a grid. It's one of the few things as an open source developer that I've actually paid money for. It's a application to just, I can then use my mouse to swipe left, swipe right, swipe up, and it goes full screen. That's all I use it for.
Other applications that I have that are independent Work 3s that make my life better with agents, I use Spokenly. Spokenly app. This one. And it's dictation? Yep, that's all it is. But it's free. They have free models. So I actually use a local NVIDIA model. And so I can come in here and be like, option key, turn this speech into text. And then I hit my option key again. And yeah, there we go. This is like a free version of WhisperFlow, which on another data science lab, we saw Joey Marshall use, which I liked, but I think it also used the option key or something. And I was like, wait, I use that key way too much. I have to remap it. So I remapped it to some other key combo. Yeah, I have my right option key because I don't ever use the right one. I use my left one. Oh man, I don't use the right one either. Yep, definitely. I use the left one for everything.
We did also have a question from Noor, which was like way back when, I think, which was like, what do we do if we're on Windows? Is there anything comparable that you know of that's on Windows? Let me see if Superset has it.
Everybody go vote because Isabella just asked a poll that is like right in line with what I just said, which is, are you a Mac user or a PC user?
Krista says, I want a full session on free tools that people can use. I want a full session on free tools that people can use to make their life with agents better. Krista, the episode with Andrew Heiss, not specific to agents, but specific to Positron workflows, he uses all kinds of tools that just make his life better.
And I think it's one of the most fun labs I've ever been a part of. I was just like mind blown the whole time learning about tool after tool after tool.
Sorry, it looks like it's only for Mac costs as well. I thought it was more. For Superset. Yeah, it at least has Linux though. Oh, no, it's sorry, Mac costs only, but there should be something coming somewhere. I don't know, I'm sorry.
It's also reminding us that Linux exists.
Yes, other useful tools that I have, I really enjoy Superpowers as a clogged skill. It is a little bit overkill, but it just gives me a routine cadence. So after installing it, read it, read the directions here.
Basic workflow is I just say slash brainstorming, and I type out two paragraphs worth of stuff. And then it walks me through everything else after that.
And that's where eventually it will do sub-agent driven development on its own, like it executes this for me. And that's where it could be 45 minutes an hour, like a long time of implementation, doing exactly what we'd written out in our plans.
And doing this workflow makes it so that it tries to get steered in the correct direction early in planning before implementing it and going, is this where you wanted to fast travel to? And it's like, no. No, you went the totally wrong direction.
Also, Amelia had posted, and she just bumped it for us, that a Reddit user suggested Paseo as a conductor alternative if you are a non-Mac user. So you can check out paseo.sh if you would like to take a look at that. Looks like another orchestrator. Amazing. There you go.
I cannot confirm whether or not it is the same sort of like work tree first situation, but it looks pretty similar as we're looking at that. Sidebar on the left and agents in the middle. I'm happy. Yeah, that's great. Perfect. Thank you so much, Amelia. That's amazing.
Garrick, no, not Garrick, Barrett. Your name is almost rhyme. It's killing my brain. With the two R's. Barrett shared the superpowers skill in the chat as well. So if you were looking for that, it is there. If you are watching this later on YouTube, everything's in the description. I have gone and I have grabbed all the links. Future Libby has grabbed all the links that Isabella is putting in the chat right now and that Barrett's putting in the chat, and you should be able to find them. And if you are watching this later and you're like, I heard someone mentioned something and I don't see it, please comment on the video. I will fix it.
So Isabella is saying, I'm realizing this is a terrible poll. Why? Because there are so many other options between Mac and PC. Split 50-50 right now, which is very surprising to me. I feel like I mostly talk to people who are Mac users, but I was a PC user for like a decade and really needed to be.
Answering the "one true worktree" question
I think that we have gotten most questions from the chat, but I see one from Dan that is unresolved. And it says, if each city is a work tree, where is the one true city? I.e. where is the one tree, one true work tree? Is that, Dan, are you asking like, who is the original clone?
Is that something you have to worry about? To Barrett, I'm saying this to Barrett. I don't know. I think that the true clone is up on GitHub. That's everything else is local checkouts.
So that is part of my question. And I don't know if it's the same question that Dan had, but you have all of these named things, right? Like we're looking at Casablanca, Jerusalem, Wellington. We had Memphis earlier. None of those are Maine, right? Or are any of your work trees basically checked out to Maine?
Correct. Maine doesn't make sense anymore because Maine is a local branch. But all of these work trees are based upon origin Maine. So they're based on the remote, like the external remote. So having a work tree that points to Maine doesn't make sense. I would actually just have feature branches nonstop that point to, that are based upon origin Maine to merge into the main branch, but you won't really ever have the main branch locally. Instead, if you want, you just make a new work tree and be like, oh, I'm in Wellington. It's basically Maine at this point. It's technically not, but it's the same spot in the Git log.
Forking worktrees and dependent changes
Do you ever get into situations where you're like, I need to go fix something, but I actually need to merge what I'm doing right now because the change that I need to make is gonna depend upon the changes that I'm making right now. That's the situation I get in, where I'm like, oh, I need to fix this, but I'm not done with what I'm doing, but the thing I need to fix is gonna depend on what I'm doing right now.
So yes, there is a trick here of fork to new workspace. So I have my WorkTreeFunAnalogies task here, and I can fork to workspace. It makes a new one, and now I'm technically in Wet'suwet'en, and this one is just actually WorkTreeFunAnalogies, and it says, please continue from this one with a summary of where we were, and so it essentially has forked my WorkTree and Cloud session over. And now we can continue here, but you get in this weird spot of like- This is WorkTree Inception. Yeah, it's in this weird spot of like, if it had files changed and things, it would bring those over as well. So manage accordingly.
It's a little hard. I would actually- This is hard. Actually, several of us in the Discord are having a hard time with this, there is no main concept. Krista says, I was okay with WorkTrees as stoves, but now no main is breaking my brain.
There's origin main, but don't worry about local main. I think that there needs to be a description of that. I know we only have five minutes left, but when you are working on your computer, you are working on local versions of what exists remotely, for example, on GitHub. It doesn't have to be GitHub, it could be GitLab, it could be something else. Did you are working on something that is a local version of that? That's why if you, like, let's say you've made a commit, or let's say you've merged something, you've merged a branch into main on the GitHub UI, you'd still don't have a version of that main on your local computer. You have to pull that down and sync your changes so that your version of main now looks like what the one at the origin looks like, right?
And your origin might live on a server too, it might not even live on GitHub server. So really, main is just another WorkTree, it's just like a version of your origin. So what Barrett is saying is, we don't ever go check out main, it's just a view of your origin. And so all of these are just views of the origin, but they're actual copies, because they're clones.
So really, main is just another WorkTree, it's just like a version of your origin.
Before WorkTrees, I actually saw Joe Chang have six or eight different copies of R Shiny on his computer. How big is that? Because he would just check out, he's like, oh, I don't wanna like deal with this right now. So he would just do a git clone into a new folder, and like, he would just manage it manually every once in a while. I don't know how he kept it straight in his head. But yeah, before WorkTrees, it was just the Wild West.
So Tom asks, so main is only relevant when you merge, and it's a moving target otherwise? Yes. I think, yeah, I think that's a good description.
Brent says, my brain broke in the first five minutes. I hope it didn't. I hope everybody is a little bit closer to understanding what a WorkTree is, the utility of WorkTrees, the use cases for WorkTrees, and maybe a little bit of how you might need them or utilize them. And I really recommend, and I was talking with Jenny Bryant about this too, the best way to play with these is just to go open something that doesn't matter and play with it. Create a WorkTree, do something with it, merge it, nonsensical changes, just open up text files, it doesn't matter. See how they work, look at the folder structure. When you open one on Positron, where does it put it? Right, like go look at that, go look at your folder structure because you might not have the same sort of like control panel that Barrett has here in Conductor if you don't use Conductor.
Folder structure and worktree organization
Let's see. I wanted to add something because Garrick had just added in the chat and I know we have two minutes left. Garrick says, typically your WorkTrees are checked out to folders that are adjacent to your one true repo. So for example, I keep my local copy of ShinyChat in one repo that is like on the PositDev path to ShinyChat. And when you create a new WorkTree, you add a new folder with a whole copy of the repo somewhere else on your computer. I usually put these in folders with like main-repo.WorkTrees so that my ShinyChat WorkTrees end up in, you know, like ShinyChat.WorkTrees. I think that that makes a lot of sense.
He says, I think Conductor kind of hides that one true repo view because it's managing all the WorkTrees for you. It's doing all of the Conductor work, which we like. So my origin one here is inside my, you know, RStudio Shiny React, Shiny React NoSync. Like that's my original. And then all of my WorkTrees are inside Barrett Conductor WorkSpaces Shiny React. So they're all over here, full copies.
And then Nathan had asked, are we operating in a world where you don't push directly to main? You just make a new branch. You still do PR to main. You are PRing to main origin, which is up remotely. So that's a fair one. If you were to do work in main and then boss comes in and says, you need to fix this right now. You have to clean up that working area, that stove, that kitchen stove. You have to clean it up before making your fix. If you were on a working branch or a WorkTree, you could do that just freely. You would just make a new one, make the fix and merge back to main. So personally, make small PRs, make many, many, many, many PRs and merge often and quickly. And WorkTrees allow for that.
So personally, make small PRs, make many, many, many, many PRs and merge often and quickly. And WorkTrees allow for that.
Amazing. Barrett, my brain's exploding in the best possible way. I hope all of you have learned so much and are thinking about ways that you can take this forward. Everybody, big round of applause for Barrett.


