Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ayushmahajan12 opened this issue Apr 24, 2025 · 0 comments

Comments

@ayushmahajan12
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant