From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
The Git worktree
From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
The Git worktree
By default, the work performed by background agents is completely isolated from your main workspace. Because the agent operates within its own Git work tree, our primary files remain untouched until we are ready to review and bring those changes into our project. A key part of this isolation is the creation of a dedicated folder on your hard drive where the agents work is saved. So that's what we're looking at here. This is my original folder. So I'm in my VS Code AI Copilot folder. I'm in the code folder and you can see my Python files here. Here's the created WorkTree folder. What happens here is Visual Studio creates another folder with the same name as my repository folder, .WorkTrees. And then for every background agent that runs, it's going to create a timestamp folder. So I'm in this WorkTree folder here. So that's what I'm looking at. So these files are in the work tree. And if you look at the timestamps, my original files are at 10.03 at night. And when I ran the agent, it…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Understand cloud and background agents5m 12s
-
(Locked)
Plan mode in Copilot: Quick review2m 25s
-
(Locked)
Session panel2m 23s
-
(Locked)
Create a plan5m 15s
-
(Locked)
Save plan as markdown1m 42s
-
(Locked)
Run the plan on background agent1m 40s
-
(Locked)
Use terminal with background agent2m
-
(Locked)
The Git worktree2m
-
(Locked)
Review the changes1m
-
(Locked)
Merge the changes1m 28s
-
(Locked)
-
-
-