2015-07-16 16 views
6

Ho installato jquery tramite npm in due app.
Guardando attraverso il package.json vedo questa differenza:Cosa significa "git +" nell'URL?

"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"

Qual è la differenza? Quale scopo serve il git+.

+1

One I s un URL e uno è un GIT-URL https://docs.npmjs.com/files/package.json#urls-as-dependencies – Hogan

risposta

3

Si dice here che ha lo scopo di specificare che è un URL git e consente di utilizzare un commettere-ish dopo un hashtag nell'URL

URL Git come dipendenze

Git URL possono essere della forma:

git: //github.com/user/project.git#commit-ish git + ssh: // utente @ hostname: project.git # commit-ish git + ssh: // utente @ hostname/pro ject.git # commit-ish git + http://[email protected]/project/blah.git#commit-ish git + https://[email protected]/project/blah.git#commit-ish

Il commit-ish può essere qualsiasi tag, sha, o la filiale che può essere fornita come argomento al git checkout. L'impostazione predefinita è master.


un commit-ish è fondamentalmente un id che git è in grado di elaborare di indirizzare alcuni contenuti specifici (tag, sha o filiale)

Per esempio diciamo che avete un commit che ha un commit sha (abbreviato) di ABCDEF12

si potrebbe usare in questo modo

git+http://[email protected]/project/blah.git#abcdef12 
+2

forse avete bisogno di spiegare che cosa un commit-ish è, o fare un esempio? – Hogan

+0

true dat, aggiornato – axelduch