Skip to content
Stars Background

The git: protocol fetches packages directly from a git repository. This is useful when you need to use a version of a package that has not been published to the npm registry.

yarn add typanion@git@github.com/arcanis/typanion.git

The target repository won’t be used as-is - it will first be packed using pack.

You can explicitly request a tag, commit, branch, or semver tag, by using one of those keywords (if you’re missing the keyword, Yarn will look for the first thing that seems to match, as in prior versions):

git@github.com:yarnpkg/berry.git#tag=@yarnpkg/cli/2.2.0
git@github.com:yarnpkg/berry.git#commit=a806c88
git@github.com:yarnpkg/berry.git#head=master

Workspaces can be cloned as long as the remote repository uses Yarn (or npm, in which case npm@>=7.x has to be installed on the system):

git@github.com:yarnpkg/berry.git#workspace=@yarnpkg/shell&tag=@yarnpkg/shell/2.1.0