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

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