pushkin
pushkin

Reputation: 10227

What does "git+" mean in the url?

I installed jquery through npm in two apps.
Looking through the package.json I see this difference:

"url": "https://github.com/jquery/jquery/blob/2.1.4/MIT-LICENSE.txt"
"url": "git+https://github.com/jquery/jquery/blob/2.1.4/MIT-LICENSE.txt"

What is the difference? What purpose does the git+ serve.

Upvotes: 15

Views: 7225

Answers (1)

axelduch
axelduch

Reputation: 10849

It is said here that it serves the purpose of specifying it is a git url and allows you to use a commit-ish after a hashtag in the url

Git URLs as Dependencies

Git urls can be of the form:

git://github.com/user/project.git#commit-ish git+ssh://user@hostname:project.git#commit-ish git+ssh://user@hostname/project.git#commit-ish git+http://user@hostname/project/blah.git#commit-ish git+https://user@hostname/project/blah.git#commit-ish

The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.


A commit-ish is basically an id that git is able to process to target some specific contents (tag, sha or branch)

For instance let's say you have a commit which has a commit sha (abbreviated) of abcdef12

You could use it like this

git+http://user@hostname/project/blah.git#abcdef12

Upvotes: 13

Related Questions