[rush] Better support for Git Worktrees
@dmichon-msft is already working on this.
Since Feb 19, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
Currently in a Rush repository, the build cache will be written to common/temp/build-cache unless overridden via the $HOME/.rush-user/settings.json file's buildCacheFolder property, and the pnpm store will be written to common/temp/pnpm-store unless overridden via the RUSH_PNPM_STORE_PATH environment variable.
In a multi-worktree environment, this results in duplication of the build cache and pnpm store, causing considerable excess disk usage.
Repro steps
Create a Git repository and multiple worktrees.
Expected result:
Only one build cache folder and one pnpm store.
Actual result:
One build cache folder and one pnpm store per worktree.
Details
We can address this by having the default computed location for the pnpm-store and the build cache folder be based on the git repository root, rather than the rush json folder, when the former is defined and the user is in a worktree.
We should also improve and standardize the configuration options.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
|---|---|
@microsoft/rush globally installed version? |
5.168.0 |
rushVersion from rush.json? |
5.168.0 |
pnpmVersion, npmVersion, or yarnVersion from rush.json? |
8.14.0 |
(if pnpm) useWorkspaces from pnpm-config.json? |
true |
| Operating system? | * |
| Would you consider contributing a PR? | Yes |
Node.js version (node -v)? |
22.16.0 |
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 708
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 62
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoft/rushstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100