Skip to content

Support installing a Git monorepo workspace from a specific branch or commit in Yarn v3/v4 #9192

Open
@ayushmahajan12

Description

@ayushmahajan12

Hi Yarn team 👋

I'm trying to install a package from a Git monorepo using a specific workspace (subfolder), while also targeting a specific branch or commit, but I haven't found any syntax that works in Yarn v3 or v4.

Here’s my monorepo structure:

immaculate-constellation/
└── packages/
    └── mobile-audio-player/

I want to install mobile-audio-player from this monorepo, from a specific branch or commit. I’ve tried something like:
yarn add mobile-audio-player@git+https://git.repo.url.git#branch:workspace=mobile-audio-player

But this results in the error:
Invalid Git resolution protocol ("branch") or isn't supported by any available resolver

✅ This works (only from the default branch):
yarn add mobile-audio-player@https://git.repo.url.git#workspace=mobile-audio-player

❓My question:
Is there a supported way in Yarn v3 or v4 to install a workspace from a specific branch or commit of a Git monorepo?

If not, is there any recommended workaround?

This would be very helpful for testing workspace packages before merging changes into the default branch.

Any help or roadmap insight would be greatly appreciated 🙏

Thanks in advance for all the great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions