Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Share persistent build cache across git worktrees #33321

Copy link
Copy link

Description

@aqeelat
Issue body actions

Command

build, serve

Description

Git worktrees allow multiple checkouts of the same repository. Each worktree currently gets its own .angular/cache directory with nearly identical contents, since they share the same source tree.

In our project, 4 active frontend worktrees consume ~140 GB of duplicated cache data. This is a significant and unnecessary disk cost.

Nx handles this automatically — when it detects a git worktree, it shares a single cache directory across all worktrees of the same repository.

Describe the solution you'd like

When the CLI detects a git worktree (via .git being a file pointing to a common git directory), resolve the default cache path relative to the common git directory instead of the worktree root. This shares one cache across all worktrees without requiring user configuration.

This is the same approach Nx uses and would make Angular's behavior consistent with Nx for the large number of projects using both together.

Describe alternatives you've considered

  • Manually setting cli.cache.path to a shared absolute path in angular.json — works but requires manual per-project configuration, is easy to forget, and the path is easy to accidentally commit to version control.
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.