| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f31ddcb commit ff081d1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,13 +26,13 @@ In the guides directory, we like to keep our NodeGit relative to the project | |||
| 26 | 26 | root. | |
| 27 | 27 | ||
| 28 | 28 | ``` javascript | |
| 29 | - var Git = require("../../../"); | ||
| 29 | + var NodeGit = require("../../../"); | ||
| 30 | 30 | ``` | |
| 31 | 31 | ||
| 32 | 32 | However, in your project you will most likely be using the following command: | |
| 33 | 33 | ||
| 34 | 34 | ``` javascript | |
| 35 | - var Git = require("nodegit"); | ||
| 35 | + var NodeGit = require("nodegit"); | ||
| 36 | 36 | ``` | |
| 37 | 37 | ||
| 38 | 38 | ### Clone URL | |
@@ -94,7 +94,7 @@ You can easily invoke our top-level Clone as a function passing along the three | |||
| 94 | 94 | aforementioned arguments. | |
| 95 | 95 | ||
| 96 | 96 | ``` javascript | |
| 97 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 97 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 98 | 98 | ``` | |
| 99 | 99 | ||
| 100 | 100 | Notice how we store the return value from `Git.Clone`. This is a | |
@@ -110,7 +110,7 @@ a function to attempt opening in this case. | |||
| 110 | 110 | ||
| 111 | 111 | ``` javascript | |
| 112 | 112 | var errorAndAttemptOpen = function() { | |
| 113 | - return Git.Repository.open(local); | ||
| 113 | + return NodeGit.Repository.open(local); | ||
| 114 | 114 | }; | |
| 115 | 115 | ``` | |
| 116 | 116 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,13 +26,13 @@ In the guides directory, we like to keep our NodeGit relative to the project | |||
| 26 | 26 | root. | |
| 27 | 27 | ||
| 28 | 28 | ``` javascript | |
| 29 | - var Git = require("../../../"); | ||
| 29 | + var NodeGit = require("../../../"); | ||
| 30 | 30 | ``` | |
| 31 | 31 | ||
| 32 | 32 | However, in your project you will most likely be using the following command: | |
| 33 | 33 | ||
| 34 | 34 | ``` javascript | |
| 35 | - var Git = require("nodegit"); | ||
| 35 | + var NodeGit = require("nodegit"); | ||
| 36 | 36 | ``` | |
| 37 | 37 | ||
| 38 | 38 | ### GitHub Personal OAuth Token | |
@@ -118,7 +118,7 @@ The `remoteCallbacks` object now looks like this: | |||
| 118 | 118 | cloneOptions.remoteCallbacks = { | |
| 119 | 119 | certificateCheck: function() { return 1; }, | |
| 120 | 120 | credentials: function() { | |
| 121 | - return Git.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); | ||
| 121 | + return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); | ||
| 122 | 122 | } | |
| 123 | 123 | }; | |
| 124 | 124 | ``` | |
@@ -129,7 +129,7 @@ You can easily invoke our top-level Clone as a function passing along the three | |||
| 129 | 129 | aforementioned arguments. | |
| 130 | 130 | ||
| 131 | 131 | ``` javascript | |
| 132 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 132 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 133 | 133 | ``` | |
| 134 | 134 | ||
| 135 | 135 | Notice how we store the return value from `Git.Clone`. This is a | |
@@ -145,7 +145,7 @@ a function to attempt opening in this case. | |||
| 145 | 145 | ||
| 146 | 146 | ``` javascript | |
| 147 | 147 | var errorAndAttemptOpen = function() { | |
| 148 | - return Git.Repository.open(local); | ||
| 148 | + return NodeGit.Repository.open(local); | ||
| 149 | 149 | }; | |
| 150 | 150 | ``` | |
| 151 | 151 | ||
@@ -163,4 +163,3 @@ cloneRepository.catch(errorAndAttemptOpen) | |||
| 163 | 163 | console.log("Is the repository bare? %s", Boolean(repository.isBare())); | |
| 164 | 164 | }); | |
| 165 | 165 | ``` | |
| 166 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | // relative path. In your project, you will use: | |
| 3 | 3 | // | |
| 4 | 4 | // var NodeGit = require("nodegit"); | |
| 5 | - var Git = require("../../../"); | ||
| 5 | + var NodeGit = require("../../../"); | ||
| 6 | 6 | ||
| 7 | 7 | // To clone with two factor auth enabled, you have to use a GitHub OAuth token | |
| 8 | 8 | // over HTTPS. | |
@@ -23,17 +23,17 @@ var cloneOptions = {}; | |||
| 23 | 23 | cloneOptions.remoteCallbacks = { | |
| 24 | 24 | certificateCheck: function() { return 1; }, | |
| 25 | 25 | credentials: function() { | |
| 26 | - return Git.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); | ||
| 26 | + return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); | ||
| 27 | 27 | } | |
| 28 | 28 | }; | |
| 29 | 29 | ||
| 30 | 30 | // Invoke the clone operation and store the returned Promise. | |
| 31 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 31 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 32 | 32 | ||
| 33 | 33 | // If the repository already exists, the clone above will fail. You can simply | |
| 34 | 34 | // open the repository in this case to continue execution. | |
| 35 | 35 | var errorAndAttemptOpen = function() { | |
| 36 | - return Git.Repository.open(localPath); | ||
| 36 | + return NodeGit.Repository.open(localPath); | ||
| 37 | 37 | }; | |
| 38 | 38 | ||
| 39 | 39 | // Once the repository has been cloned or opened, you can work with a returned | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | // relative path. In your project, you will use: | |
| 3 | 3 | // | |
| 4 | 4 | // var NodeGit = require("nodegit"); | |
| 5 | - var Git = require("../../../"); | ||
| 5 | + var NodeGit = require("../../../"); | ||
| 6 | 6 | ||
| 7 | 7 | // Using the `clone` method from the `Git.Clone` module, bring down the NodeGit | |
| 8 | 8 | // test repository from GitHub. | |
@@ -21,12 +21,12 @@ cloneOptions.remoteCallbacks = { | |||
| 21 | 21 | }; | |
| 22 | 22 | ||
| 23 | 23 | // Invoke the clone operation and store the returned Promise. | |
| 24 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 24 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 25 | 25 | ||
| 26 | 26 | // If the repository already exists, the clone above will fail. You can simply | |
| 27 | 27 | // open the repository in this case to continue execution. | |
| 28 | 28 | var errorAndAttemptOpen = function() { | |
| 29 | - return Git.Repository.open(localPath); | ||
| 29 | + return NodeGit.Repository.open(localPath); | ||
| 30 | 30 | }; | |
| 31 | 31 | ||
| 32 | 32 | // Once the repository has been cloned or opened, you can work with a returned | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,13 +26,13 @@ In the guides directory, we like to keep our NodeGit relative to the project | |||
| 26 | 26 | root. | |
| 27 | 27 | ||
| 28 | 28 | ``` javascript | |
| 29 | - var Git = require("../../../"); | ||
| 29 | + var NodeGit = require("../../../"); | ||
| 30 | 30 | ``` | |
| 31 | 31 | ||
| 32 | 32 | However, in your project you will most likely be using the following command: | |
| 33 | 33 | ||
| 34 | 34 | ``` javascript | |
| 35 | - var Git = require("nodegit"); | ||
| 35 | + var NodeGit = require("nodegit"); | ||
| 36 | 36 | ``` | |
| 37 | 37 | ||
| 38 | 38 | ### Clone URL | |
@@ -101,7 +101,7 @@ The `remoteCallbacks` object now looks like this: | |||
| 101 | 101 | cloneOptions.remoteCallbacks = { | |
| 102 | 102 | certificateCheck: function() { return 1; }, | |
| 103 | 103 | credentials: function(url, userName) { | |
| 104 | - return Git.Cred.sshKeyFromAgent(userName); | ||
| 104 | + return NodeGit.Cred.sshKeyFromAgent(userName); | ||
| 105 | 105 | } | |
| 106 | 106 | }; | |
| 107 | 107 | ``` | |
@@ -117,7 +117,7 @@ You can easily invoke our top-level Clone as a function passing along the three | |||
| 117 | 117 | aforementioned arguments. | |
| 118 | 118 | ||
| 119 | 119 | ``` javascript | |
| 120 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 120 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 121 | 121 | ``` | |
| 122 | 122 | ||
| 123 | 123 | Notice how we store the return value from `Git.Clone`. This is a | |
@@ -133,7 +133,7 @@ a function to attempt opening in this case. | |||
| 133 | 133 | ||
| 134 | 134 | ``` javascript | |
| 135 | 135 | var errorAndAttemptOpen = function() { | |
| 136 | - return Git.Repository.open(local); | ||
| 136 | + return NodeGit.Repository.open(local); | ||
| 137 | 137 | }; | |
| 138 | 138 | ``` | |
| 139 | 139 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | // relative path. In your project, you will use: | |
| 3 | 3 | // | |
| 4 | 4 | // var NodeGit = require("nodegit"); | |
| 5 | - var Git = require("../../../"); | ||
| 5 | + var NodeGit = require("../../../"); | ||
| 6 | 6 | ||
| 7 | 7 | // Set the URL that NodeGit will connect to clone. | |
| 8 | 8 | var cloneURL = "git@github.com:nodegit/test"; | |
@@ -22,17 +22,17 @@ cloneOptions.remoteCallbacks = { | |||
| 22 | 22 | // `userName` argument to the `sshKeyFromAgent` function to validate | |
| 23 | 23 | // authentication. | |
| 24 | 24 | credentials: function(url, userName) { | |
| 25 | - return Git.Cred.sshKeyFromAgent(userName); | ||
| 25 | + return NodeGit.Cred.sshKeyFromAgent(userName); | ||
| 26 | 26 | } | |
| 27 | 27 | }; | |
| 28 | 28 | ||
| 29 | 29 | // Invoke the clone operation and store the returned Promise. | |
| 30 | - var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions); | ||
| 30 | + var cloneRepository = NodeGit.Clone(cloneURL, localPath, cloneOptions); | ||
| 31 | 31 | ||
| 32 | 32 | // If the repository already exists, the clone above will fail. You can simply | |
| 33 | 33 | // open the repository in this case to continue execution. | |
| 34 | 34 | var errorAndAttemptOpen = function() { | |
| 35 | - return Git.Repository.open(localPath); | ||
| 35 | + return NodeGit.Repository.open(localPath); | ||
| 36 | 36 | }; | |
| 37 | 37 | ||
| 38 | 38 | // Once the repository has been cloned or opened, you can work with a returned | |
| Back | FazBrowse Home | New Git URL |
0 commit comments