Const VALID_PATTERNS
VALID_PATTERNS: string[] = [`GitHubOrg/foo-bar.js`,`GitHubOrg/foo2bar.js`,`GitHubOrg/foo-bar.js#hash`,`GitHubOrg/foo-bar.js#commit:hash`,`GitHubOrg/foo-bar.js#commit=hash`,`GitHubOrg/foo-bar.js#commit=hash&workspace=foo`,`GitHubOrg/foo-bar.js#tag=hello`,`GitHubOrg/foo-bar.js#workspace=foo`,`github:GitHubOrg/foo-bar.js`,`github:GitHubOrg/foo-bar.js#hash`,`https://github.com/yarnpkg/util-deprecate.git#v1.0.0`,`https://github.com/yarnpkg/util-deprecate.git#semver:v1.0.0`,`https://github.com/yarnpkg/util-deprecate.git#master`,`https://github.com/yarnpkg/util-deprecate.git#b3562c2798507869edb767da869cd7b85487726d`,`https://github.com/yarnpkg/util-deprecate/tarball/b3562c2798507869edb767da869cd7b85487726d`,`git://github.com/yarnpkg/util-deprecate.git#v1.0.1`,`git+ssh://git@github.com/yarnpkg/util-deprecate.git#v1.0.1`,`ssh://git@github.com/yarnpkg/util-deprecate.git#v1.0.1`,`git+ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,`ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,`git+https://github.com/yarnpkg/util-deprecate#v1.0.1`,`git+https://github.com/yarnpkg/util-deprecate.git#v1.0.1`,]
Const gitPatterns
gitPatterns: RegExp[] = [/^ssh:/,/^git(?:\+[^:]+)?:/,// `git+` is optional, `.git` is required/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,// GitHub `/tarball/` URLs/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,]
@yarnpkg/plugin-git
This plugin adds support for cloning packages from Git repositories.
Install
This plugin is included by default in Yarn.