Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "git+" mean in the url?

Tags:

git

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.

like image 531
pushkin Avatar asked Jul 16 '15 14:07

pushkin


1 Answers

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
like image 69
axelduch Avatar answered Oct 14 '22 22:10

axelduch