To set this up cleanly in PowerShell, we will create a parent directory and then use the git clone --bare or "move and repair" strategy. However, the most straightforward way for a fresh setup is to treat one directory as your "base" and add the others as worktrees alongside it.
Here are the PowerShell commands to build your workspace from scratch.
1. Create the Project Parent Directory
First, move out of your current folder and create the container for all your worktrees.
# Create and enter the parent directory
New-Item -Path "C:\Users\doug\code\dtactions-workspace" -ItemType Directory
Set-Location "C:\Users\doug\code\dtactions-workspace"
2. Initialize the "Main" Worktree
We will clone the repository into the main folder. This will serve as your primary repo where the .git data actually lives.
# Clone the 'dt' version into a folder named 'main'
git clone https://github.com/dictation-toolbox/dtactions.git main
Set-Location .\main
# Set up your remotes
git remote add doug https://github.com/dougransom/dtactions.git
git remote rename origin dt
# (Optional) upstream is the same as dt in your config
git remote add upstream https://github.com/dictation-toolbox/dtactions.git
# Fetch all data from all remotes
git fetch --all
3. Create the "Broke" Worktree
Now, while still inside the main folder, tell Git to create a second working directory one level up.
# Add worktree: Path is ../broke_dtactions_unimacro
# The branch is tracked from the 'doug' remote
git worktree add ../broke_dtactions_unimacro -b broke_dtactions_unimacro doug/broke_dtactions_unimacro
4. Verify Your Setup
You can now see how Git is managing these separate folders.
# List all active worktrees
git worktree list
Summary of Directory Result
Your folder structure will now look like this:
C:\Users\doug\code\dtactions-workspace\
main\ (Running the main branch from dt)
broke_dtactions_unimacro\ (Running the broke... branch from doug)
A Quick Tip for PowerShell: When you switch between these folders, remember that each folder has its own "checked out" state. If you run git status in main, it shows the status of the main branch. If you cd ..\broke_dtactions_unimacro and run git status, it shows the status for your specific feature branch. Both utilize the exact same .git database stored in the main folder.
Since you mentioned you want to "run each one as you see fit," do you need help setting up separate Python virtual environments for each worktree so their dependencies don't clash?
To set this up cleanly in PowerShell, we will create a parent directory and then use the
git clone --bareor "move and repair" strategy. However, the most straightforward way for a fresh setup is to treat one directory as your "base" and add the others as worktrees alongside it.Here are the PowerShell commands to build your workspace from scratch.
1. Create the Project Parent Directory
First, move out of your current folder and create the container for all your worktrees.
2. Initialize the "Main" Worktree
We will clone the repository into the
mainfolder. This will serve as your primary repo where the.gitdata actually lives.3. Create the "Broke" Worktree
Now, while still inside the
mainfolder, tell Git to create a second working directory one level up.4. Verify Your Setup
You can now see how Git is managing these separate folders.
# List all active worktrees git worktree listSummary of Directory Result
Your folder structure will now look like this:
C:\Users\doug\code\dtactions-workspace\main\(Running themainbranch fromdt)broke_dtactions_unimacro\(Running thebroke...branch fromdoug)A Quick Tip for PowerShell: When you switch between these folders, remember that each folder has its own "checked out" state. If you run
git statusinmain, it shows the status of themainbranch. If youcd ..\broke_dtactions_unimacroand rungit status, it shows the status for your specific feature branch. Both utilize the exact same.gitdatabase stored in themainfolder.Since you mentioned you want to "run each one as you see fit," do you need help setting up separate Python virtual environments for each worktree so their dependencies don't clash?