Depend on a branch or tag using a git URL in a package.json?

From the npm docs, using a git URL:

git://github.com/<user>/<project>.git#<branch>

git://github.com/<user>/<project>.git#feature\/<branch>

As of NPM version 1.1.65, you can use a shorten github URL:

<user>/<project>#<branch>

UPDATE 2022

Don’t use git:// protocol for GitHub, as it is not supported

npm ERR!   The unauthenticated git protocol on port 9418 is no longer supported.
npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Leave a Comment