worktree Skill
Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched. Published by microsoft in service-fabric-dotnet.
What is worktree Skill?
Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched. Published by microsoft in service-fabric-dotnet. This profile combines repository metadata with install, compatibility, and usage signals so developers can quickly decide whether it fits their agent workflow before opening the source repository.
Automated repository signals based on public metadata such as recency, license, installation evidence, and adoption. These are not a security audit or endorsement.
Key capabilities
- Includes SKILL.md support
- Reusable instructions support
- Testing
- Testing use cases
Technical details
- Install or run with Copy skill directory
When to use worktree Skill
- Use it for testing.
Built with
Editorial notes
Source
- Creator: microsoft
- Repository: microsoft/service-fabric-dotnet
- Skill file: .github/skills/worktree/SKILL.md
What it does
Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched.
Skill instructions
Set Up Reuse the existing worktree if present, otherwise create one. Run subsequent steps from the worktree directory. pwsh $pr = <N $repo = git rev-parse --show-toplevel Guard against recursion if the current working tree is already a worktree under <repo.worktrees if ((Split-Path (Split-Path $repo -Parent) -Leaf) -match '.worktrees$') { $repo = (git worktree list --porcelain | Select-String -Pattern '^worktree ' | Select-Object -First 1).Line.Substring(9) } $branch = gh pr view $pr --json headRefName -q .headRefName $folder = $branch -replace '[^A-Za-z0-9.-]', '-' $worktree = Join-Path "$repo.worktrees" $folder if (-not (Test-Path $worktree)) { git worktree add --no-checkout $worktree HEAD Push-Location $worktree gh pr checkout $pr Pop-Location } Push-Location $worktree Tear Down When the caller is done with the worktree and didn't make any changes, remove it and the local branch. Otherwise, instruct the user how to do this. pwsh Pop-Location git worktree remove $worktree git branch
Explore related resources
Frequently asked questions
What is worktree?
worktree is a open-source AI agent skill with Copy skill directory. Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch.
Who is worktree best for?
worktree is best for reusing agent instructions, scripts, and references, testing workflows.
How do I install worktree?
Install or run worktree using Copy skill directory. Check worktree for the latest setup command.
Is worktree actively maintained?
worktree may need a closer maintenance check before production use.
Auto-fetched from GitHub.