| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1038,20 +1038,21 @@ sections: | |||
| 1038 | 1038 | ||
| 1039 | 1039 | | Class Methods | | | |
| 1040 | 1040 | | --- | ---: | | |
| 1041 | - | [<span>Pathspec.</span>matchListDiffEntry <span>(m, pos)</span>](/api/pathspec/#matchListDiffEntry) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1042 | - | [<span>Pathspec.</span>matchListEntry <span>(m, pos)</span>](/api/pathspec/#matchListEntry) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1043 | - | [<span>Pathspec.</span>matchListEntrycount <span>(m)</span>](/api/pathspec/#matchListEntrycount) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1044 | - | [<span>Pathspec.</span>matchListFailedEntry <span>(m, pos)</span>](/api/pathspec/#matchListFailedEntry) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1045 | - | [<span>Pathspec.</span>matchListFailedEntrycount <span>(m)</span>](/api/pathspec/#matchListFailedEntrycount) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1041 | + | [<span>Pathspec.</span>create <span>(pathspec)</span>](/api/pathspec/#create) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1042 | + | [<span>Pathspec.</span>matchListDiffEntry <span>(m, pos)</span>](/api/pathspec/#matchListDiffEntry) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1043 | + | [<span>Pathspec.</span>matchListEntry <span>(m, pos)</span>](/api/pathspec/#matchListEntry) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1044 | + | [<span>Pathspec.</span>matchListEntrycount <span>(m)</span>](/api/pathspec/#matchListEntrycount) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1045 | + | [<span>Pathspec.</span>matchListFailedEntry <span>(m, pos)</span>](/api/pathspec/#matchListFailedEntry) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1046 | + | [<span>Pathspec.</span>matchListFailedEntrycount <span>(m)</span>](/api/pathspec/#matchListFailedEntrycount) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1046 | 1047 | ||
| 1047 | 1048 | | Instance Methods | | | |
| 1048 | 1049 | | --- | ---: | | |
| 1049 | - | [<span>Pathspec#</span>free <span>()</span>](/api/pathspec/#free) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1050 | - | [<span>Pathspec#</span>matchDiff <span>(diff, flags)</span>](/api/pathspec/#matchDiff) | <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | | ||
| 1051 | - | [<span>Pathspec#</span>matchIndex <span>(index, flags)</span>](/api/pathspec/#matchIndex) | <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | | ||
| 1052 | - | [<span>Pathspec#</span>matchTree <span>(tree, flags)</span>](/api/pathspec/#matchTree) | <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | | ||
| 1053 | - | [<span>Pathspec#</span>matchWorkdir <span>(repo, flags)</span>](/api/pathspec/#matchWorkdir) | <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | | ||
| 1054 | - | [<span>Pathspec#</span>matchesPath <span>(flags, path)</span>](/api/pathspec/#matchesPath) | <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | | ||
| 1050 | + | [<span>Pathspec#</span>free <span>()</span>](/api/pathspec/#free) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1051 | + | [<span>Pathspec#</span>matchDiff <span>(diff, flags)</span>](/api/pathspec/#matchDiff) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1052 | + | [<span>Pathspec#</span>matchIndex <span>(index, flags)</span>](/api/pathspec/#matchIndex) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1053 | + | [<span>Pathspec#</span>matchTree <span>(tree, flags)</span>](/api/pathspec/#matchTree) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1054 | + | [<span>Pathspec#</span>matchWorkdir <span>(repo, flags)</span>](/api/pathspec/#matchWorkdir) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1055 | + | [<span>Pathspec#</span>matchesPath <span>(flags, path)</span>](/api/pathspec/#matchesPath) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1055 | 1056 | ||
| 1056 | 1057 | | ENUMS | | | |
| 1057 | 1058 | | --- | ---: | | |
@@ -1224,7 +1225,6 @@ sections: | |||
| 1224 | 1225 | | [<span>Remote.</span>isValidName <span>(remote_name)</span>](/api/remote/#isValidName) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1225 | 1226 | | [<span>Remote.</span>list <span>(repo)</span>](/api/remote/#list) | <span class="tags"><span class="async">Async</span></span> | | |
| 1226 | 1227 | | [<span>Remote.</span>lookup <span>(repo, name, callback)</span>](/api/remote/#lookup) | <span class="tags"><span class="async">Async</span></span> | | |
| 1227 | - | [<span>Remote.</span>push <span>(refSpecs, options, signature, message)</span>](/api/remote/#push) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1228 | 1228 | ||
| 1229 | 1229 | | Instance Methods | | | |
| 1230 | 1230 | | --- | ---: | | |
@@ -1243,11 +1243,12 @@ sections: | |||
| 1243 | 1243 | | [<span>Remote#</span>getFetchRefspecs <span>()</span>](/api/remote/#getFetchRefspecs) | <span class="tags"><span class="async">Async</span></span> | | |
| 1244 | 1244 | | [<span>Remote#</span>getPushRefspecs <span>()</span>](/api/remote/#getPushRefspecs) | <span class="tags"><span class="async">Async</span></span> | | |
| 1245 | 1245 | | [<span>Remote#</span>getRefspec <span>(n)</span>](/api/remote/#getRefspec) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1246 | + | [<span>Remote#</span>ls <span>(size)</span>](/api/remote/#ls) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1246 | 1247 | | [<span>Remote#</span>name <span>()</span>](/api/remote/#name) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1247 | 1248 | | [<span>Remote#</span>owner <span>()</span>](/api/remote/#owner) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1248 | 1249 | | [<span>Remote#</span>prune <span>()</span>](/api/remote/#prune) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1249 | 1250 | | [<span>Remote#</span>pruneRefs <span>()</span>](/api/remote/#pruneRefs) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1250 | - | [<span>Remote#</span>push <span>(refspecs, opts, signature, reflog_message)</span>](/api/remote/#push) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1251 | + | [<span>Remote#</span>push <span>(refSpecs, options, signature, message)</span>](/api/remote/#push) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1251 | 1252 | | [<span>Remote#</span>pushurl <span>()</span>](/api/remote/#pushurl) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1252 | 1253 | | [<span>Remote#</span>refspecCount <span>()</span>](/api/remote/#refspecCount) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1253 | 1254 | | [<span>Remote#</span>save <span>()</span>](/api/remote/#save) | <span class="tags"><span class="sync">Sync</span></span> | | |
@@ -1293,6 +1294,7 @@ sections: | |||
| 1293 | 1294 | ||
| 1294 | 1295 | | Instance Methods | | | |
| 1295 | 1296 | | --- | ---: | | |
| 1297 | + | [<span>Repository#</span>checkoutBranch <span>(branch, opts)</span>](/api/repository/#checkoutBranch) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1296 | 1298 | | [<span>Repository#</span>config <span>()</span>](/api/repository/#config) | <span class="tags"><span class="async">Async</span></span> | | |
| 1297 | 1299 | | [<span>Repository#</span>configSnapshot <span>()</span>](/api/repository/#configSnapshot) | <span class="tags"><span class="async">Async</span></span> | | |
| 1298 | 1300 | | [<span>Repository#</span>createLightweightTag <span>(String, name)</span>](/api/repository/#createLightweightTag) | <span class="tags"><span class="async">Async</span></span> | | |
@@ -1326,7 +1328,7 @@ sections: | |||
| 1326 | 1328 | | [<span>Repository#</span>odb <span>()</span>](/api/repository/#odb) | <span class="tags"><span class="async">Async</span></span> | | |
| 1327 | 1329 | | [<span>Repository#</span>path <span>()</span>](/api/repository/#path) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1328 | 1330 | | [<span>Repository#</span>refdb <span>()</span>](/api/repository/#refdb) | <span class="tags"><span class="async">Async</span></span> | | |
| 1329 | - | [<span>Repository#</span>setHead <span>(refname, signature, log_message)</span>](/api/repository/#setHead) | <span class="tags"><span class="sync">Sync</span></span> | | ||
| 1331 | + | [<span>Repository#</span>setHead <span>(refname, signature, log_message)</span>](/api/repository/#setHead) | <span class="tags"><span class="async">Async</span></span> | | ||
| 1330 | 1332 | | [<span>Repository#</span>setHeadDetached <span>(commitish, signature, log_message)</span>](/api/repository/#setHeadDetached) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1331 | 1333 | | [<span>Repository#</span>setNamespace <span>(nmspace)</span>](/api/repository/#setNamespace) | <span class="tags"><span class="sync">Sync</span></span> | | |
| 1332 | 1334 | | [<span>Repository#</span>setWorkdir <span>(workdir, update_gitlink)</span>](/api/repository/#setWorkdir) | <span class="tags"><span class="sync">Sync</span></span> | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ menu_item: api | |||
| 7 | 7 | return_to: | |
| 8 | 8 | "API Documentation Index": /api/ | |
| 9 | 9 | sections: | |
| 10 | + "create": "#create" | ||
| 10 | 11 | "matchListDiffEntry": "#matchListDiffEntry" | |
| 11 | 12 | "matchListEntry": "#matchListEntry" | |
| 12 | 13 | "matchListEntrycount": "#matchListEntrycount" | |
@@ -21,7 +22,23 @@ sections: | |||
| 21 | 22 | "FLAG": "#FLAG" | |
| 22 | 23 | --- | |
| 23 | 24 | ||
| 24 | - ## <a name="matchListDiffEntry"></a><span>Pathspec.</span>matchListDiffEntry <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 25 | + ## <a name="create"></a><span>Pathspec.</span>create <span class="tags"><span class="async">Async</span></span> | ||
| 26 | + | ||
| 27 | + ```js | ||
| 28 | + Pathspec.create(pathspec).then(function(pathspec) { | ||
| 29 | + // Use pathspec | ||
| 30 | + }); | ||
| 31 | + ``` | ||
| 32 | + | ||
| 33 | + | Parameters | Type | | | ||
| 34 | + | --- | --- | --- | | ||
| 35 | + | pathspec | [Strarray](/api/strarray/) | A git_strarray of the paths to match | | ||
| 36 | + | ||
| 37 | + | Returns | | | ||
| 38 | + | --- | --- | | ||
| 39 | + | [Pathspec](/api/pathspec/) | Output of the compiled pathspec | | ||
| 40 | + | ||
| 41 | + ## <a name="matchListDiffEntry"></a><span>Pathspec.</span>matchListDiffEntry <span class="tags"><span class="sync">Sync</span></span> | ||
| 25 | 42 | ||
| 26 | 43 | ```js | |
| 27 | 44 | var diffDelta = Pathspec.matchListDiffEntry(m, pos); | |
@@ -36,7 +53,7 @@ var diffDelta = Pathspec.matchListDiffEntry(m, pos); | |||
| 36 | 53 | | --- | --- | | |
| 37 | 54 | | [DiffDelta](/api/diff_delta/) | The filename of the match | | |
| 38 | 55 | ||
| 39 | - ## <a name="matchListEntry"></a><span>Pathspec.</span>matchListEntry <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 56 | + ## <a name="matchListEntry"></a><span>Pathspec.</span>matchListEntry <span class="tags"><span class="sync">Sync</span></span> | ||
| 40 | 57 | ||
| 41 | 58 | ```js | |
| 42 | 59 | var string = Pathspec.matchListEntry(m, pos); | |
@@ -51,7 +68,7 @@ var string = Pathspec.matchListEntry(m, pos); | |||
| 51 | 68 | | --- | --- | | |
| 52 | 69 | | String | The filename of the match | | |
| 53 | 70 | ||
| 54 | - ## <a name="matchListEntrycount"></a><span>Pathspec.</span>matchListEntrycount <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 71 | + ## <a name="matchListEntrycount"></a><span>Pathspec.</span>matchListEntrycount <span class="tags"><span class="sync">Sync</span></span> | ||
| 55 | 72 | ||
| 56 | 73 | ```js | |
| 57 | 74 | var result = Pathspec.matchListEntrycount(m); | |
@@ -65,7 +82,7 @@ var result = Pathspec.matchListEntrycount(m); | |||
| 65 | 82 | | --- | --- | | |
| 66 | 83 | | Number | Number of items in match list | | |
| 67 | 84 | ||
| 68 | - ## <a name="matchListFailedEntry"></a><span>Pathspec.</span>matchListFailedEntry <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 85 | + ## <a name="matchListFailedEntry"></a><span>Pathspec.</span>matchListFailedEntry <span class="tags"><span class="sync">Sync</span></span> | ||
| 69 | 86 | ||
| 70 | 87 | ```js | |
| 71 | 88 | var string = Pathspec.matchListFailedEntry(m, pos); | |
@@ -80,7 +97,7 @@ var string = Pathspec.matchListFailedEntry(m, pos); | |||
| 80 | 97 | | --- | --- | | |
| 81 | 98 | | String | The pathspec pattern that didn't match anything | | |
| 82 | 99 | ||
| 83 | - ## <a name="matchListFailedEntrycount"></a><span>Pathspec.</span>matchListFailedEntrycount <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 100 | + ## <a name="matchListFailedEntrycount"></a><span>Pathspec.</span>matchListFailedEntrycount <span class="tags"><span class="sync">Sync</span></span> | ||
| 84 | 101 | ||
| 85 | 102 | ```js | |
| 86 | 103 | var result = Pathspec.matchListFailedEntrycount(m); | |
@@ -94,13 +111,13 @@ var result = Pathspec.matchListFailedEntrycount(m); | |||
| 94 | 111 | | --- | --- | | |
| 95 | 112 | | Number | Number of items in original pathspec that had no matches | | |
| 96 | 113 | ||
| 97 | - ## <a name="free"></a><span>Pathspec#</span>free <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 114 | + ## <a name="free"></a><span>Pathspec#</span>free <span class="tags"><span class="sync">Sync</span></span> | ||
| 98 | 115 | ||
| 99 | 116 | ```js | |
| 100 | 117 | pathspec.free(); | |
| 101 | 118 | ``` | |
| 102 | 119 | ||
| 103 | - ## <a name="matchDiff"></a><span>Pathspec#</span>matchDiff <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | ||
| 120 | + ## <a name="matchDiff"></a><span>Pathspec#</span>matchDiff <span class="tags"><span class="async">Async</span></span> | ||
| 104 | 121 | ||
| 105 | 122 | ```js | |
| 106 | 123 | pathspec.matchDiff(diff, flags).then(function(pathspecMatchList) { | |
@@ -117,7 +134,7 @@ pathspec.matchDiff(diff, flags).then(function(pathspecMatchList) { | |||
| 117 | 134 | | --- | --- | | |
| 118 | 135 | | [PathspecMatchList](/api/pathspec_match_list/) | Output list of matches; pass NULL to just get return value | | |
| 119 | 136 | ||
| 120 | - ## <a name="matchIndex"></a><span>Pathspec#</span>matchIndex <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | ||
| 137 | + ## <a name="matchIndex"></a><span>Pathspec#</span>matchIndex <span class="tags"><span class="async">Async</span></span> | ||
| 121 | 138 | ||
| 122 | 139 | ```js | |
| 123 | 140 | pathspec.matchIndex(index, flags).then(function(pathspecMatchList) { | |
@@ -134,7 +151,7 @@ pathspec.matchIndex(index, flags).then(function(pathspecMatchList) { | |||
| 134 | 151 | | --- | --- | | |
| 135 | 152 | | [PathspecMatchList](/api/pathspec_match_list/) | Output list of matches; pass NULL to just get return value | | |
| 136 | 153 | ||
| 137 | - ## <a name="matchTree"></a><span>Pathspec#</span>matchTree <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | ||
| 154 | + ## <a name="matchTree"></a><span>Pathspec#</span>matchTree <span class="tags"><span class="async">Async</span></span> | ||
| 138 | 155 | ||
| 139 | 156 | ```js | |
| 140 | 157 | pathspec.matchTree(tree, flags).then(function(pathspecMatchList) { | |
@@ -151,7 +168,7 @@ pathspec.matchTree(tree, flags).then(function(pathspecMatchList) { | |||
| 151 | 168 | | --- | --- | | |
| 152 | 169 | | [PathspecMatchList](/api/pathspec_match_list/) | Output list of matches; pass NULL to just get return value | | |
| 153 | 170 | ||
| 154 | - ## <a name="matchWorkdir"></a><span>Pathspec#</span>matchWorkdir <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span> | ||
| 171 | + ## <a name="matchWorkdir"></a><span>Pathspec#</span>matchWorkdir <span class="tags"><span class="async">Async</span></span> | ||
| 155 | 172 | ||
| 156 | 173 | ```js | |
| 157 | 174 | pathspec.matchWorkdir(repo, flags).then(function(pathspecMatchList) { | |
@@ -168,7 +185,7 @@ pathspec.matchWorkdir(repo, flags).then(function(pathspecMatchList) { | |||
| 168 | 185 | | --- | --- | | |
| 169 | 186 | | [PathspecMatchList](/api/pathspec_match_list/) | Output list of matches; pass NULL to just get return value | | |
| 170 | 187 | ||
| 171 | - ## <a name="matchesPath"></a><span>Pathspec#</span>matchesPath <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span> | ||
| 188 | + ## <a name="matchesPath"></a><span>Pathspec#</span>matchesPath <span class="tags"><span class="sync">Sync</span></span> | ||
| 172 | 189 | ||
| 173 | 190 | ```js | |
| 174 | 191 | var result = pathspec.matchesPath(flags, path); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,6 @@ sections: | |||
| 15 | 15 | "isValidName": "#isValidName" | |
| 16 | 16 | "list": "#list" | |
| 17 | 17 | "lookup": "#lookup" | |
| 18 | - "push": "#push" | ||
| 19 | 18 | "#addFetch": "#addFetch" | |
| 20 | 19 | "#addPush": "#addPush" | |
| 21 | 20 | "#autotag": "#autotag" | |
@@ -31,6 +30,7 @@ sections: | |||
| 31 | 30 | "#getFetchRefspecs": "#getFetchRefspecs" | |
| 32 | 31 | "#getPushRefspecs": "#getPushRefspecs" | |
| 33 | 32 | "#getRefspec": "#getRefspec" | |
| 33 | + "#ls": "#ls" | ||
| 34 | 34 | "#name": "#name" | |
| 35 | 35 | "#owner": "#owner" | |
| 36 | 36 | "#prune": "#prune" | |
@@ -189,28 +189,6 @@ Retrieves the remote by name | |||
| 189 | 189 | | --- | --- | | |
| 190 | 190 | | [Remote](/api/remote/) | | | |
| 191 | 191 | ||
| 192 | - ## <a name="push"></a><span>Remote.</span>push <span class="tags"><span class="async">Async</span></span> | ||
| 193 | - | ||
| 194 | - ```js | ||
| 195 | - Remote.push(refSpecs, options, signature, message).then(function(number) { | ||
| 196 | - // Use number | ||
| 197 | - }); | ||
| 198 | - ``` | ||
| 199 | - | ||
| 200 | - Pushes to a remote | ||
| 201 | - | ||
| 202 | - | ||
| 203 | - | Parameters | Type | | | ||
| 204 | - | --- | --- | --- | | ||
| 205 | - | refSpecs | Array | The ref specs that should be pushed | | ||
| 206 | - | options | [PushOptions](/api/push_options/) | Options for the checkout | | ||
| 207 | - | signature | [Signature](/api/signature/) | The identity to use for the reflog of the updated references | | ||
| 208 | - | message | String | The message to use for the update reflog messages | | ||
| 209 | - | ||
| 210 | - | Returns | | | ||
| 211 | - | --- | --- | | ||
| 212 | - | Number | error code | | ||
| 213 | - | ||
| 214 | 192 | ## <a name="addFetch"></a><span>Remote#</span>addFetch <span class="tags"><span class="sync">Sync</span></span> | |
| 215 | 193 | ||
| 216 | 194 | ```js | |
@@ -388,6 +366,22 @@ var refspec = remote.getRefspec(n); | |||
| 388 | 366 | | --- | --- | | |
| 389 | 367 | | [Refspec](/api/refspec/) | the nth refspec | | |
| 390 | 368 | ||
| 369 | + ## <a name="ls"></a><span>Remote#</span>ls <span class="tags"><span class="async">Async</span></span> | ||
| 370 | + | ||
| 371 | + ```js | ||
| 372 | + remote.ls(size).then(function(result) { | ||
| 373 | + // Use result | ||
| 374 | + }); | ||
| 375 | + ``` | ||
| 376 | + | ||
| 377 | + | Parameters | Type | | ||
| 378 | + | --- | --- | --- | | ||
| 379 | + | size | Number | the number of remote heads | | ||
| 380 | + | ||
| 381 | + | Returns | | | ||
| 382 | + | --- | --- | | ||
| 383 | + | Number | 0 on success, or an error code | | ||
| 384 | + | ||
| 391 | 385 | ## <a name="name"></a><span>Remote#</span>name <span class="tags"><span class="sync">Sync</span></span> | |
| 392 | 386 | ||
| 393 | 387 | ```js | |
@@ -431,21 +425,24 @@ var result = remote.pruneRefs(); | |||
| 431 | 425 | ## <a name="push"></a><span>Remote#</span>push <span class="tags"><span class="async">Async</span></span> | |
| 432 | 426 | ||
| 433 | 427 | ```js | |
| 434 | - remote.push(refspecs, opts, signature, reflog_message).then(function(result) { | ||
| 435 | - // Use result | ||
| 428 | + remote.push(refSpecs, options, signature, message).then(function(number) { | ||
| 429 | + // Use number | ||
| 436 | 430 | }); | |
| 437 | 431 | ``` | |
| 438 | 432 | ||
| 433 | + Pushes to a remote | ||
| 434 | + | ||
| 435 | + | ||
| 439 | 436 | | Parameters | Type | | |
| 440 | 437 | | --- | --- | --- | | |
| 441 | - | refspecs | [Strarray](/api/strarray/) | the refspecs to use for pushing. If none are passed, the configured refspecs will be used | | ||
| 442 | - | opts | [PushOptions](/api/push_options/) | the options | | ||
| 443 | - | signature | [Signature](/api/signature/) | signature to use for the reflog of updated references | | ||
| 444 | - | reflog_message | String | message to use for the reflog of upated references | | ||
| 438 | + | refSpecs | Array | The ref specs that should be pushed | | ||
| 439 | + | options | [PushOptions](/api/push_options/) | Options for the checkout | | ||
| 440 | + | signature | [Signature](/api/signature/) | The identity to use for the reflog of the updated references | | ||
| 441 | + | message | String | The message to use for the update reflog messages | | ||
| 445 | 442 | ||
| 446 | 443 | | Returns | | | |
| 447 | 444 | | --- | --- | | |
| 448 | - | Number | | | ||
| 445 | + | Number | error code | | ||
| 449 | 446 | ||
| 450 | 447 | ## <a name="pushurl"></a><span>Remote#</span>pushurl <span class="tags"><span class="sync">Sync</span></span> | |
| 451 | 448 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ sections: | |||
| 13 | 13 | "openBare": "#openBare" | |
| 14 | 14 | "openExt": "#openExt" | |
| 15 | 15 | "wrapOdb": "#wrapOdb" | |
| 16 | + "#checkoutBranch": "#checkoutBranch" | ||
| 16 | 17 | "#config": "#config" | |
| 17 | 18 | "#configSnapshot": "#configSnapshot" | |
| 18 | 19 | "#createLightweightTag": "#createLightweightTag" | |
@@ -159,6 +160,21 @@ Repository.wrapOdb(odb).then(function(repository) { | |||
| 159 | 160 | | --- | --- | | |
| 160 | 161 | | [Repository](/api/repository/) | | | |
| 161 | 162 | ||
| 163 | + ## <a name="checkoutBranch"></a><span>Repository#</span>checkoutBranch <span class="tags"><span class="sync">Sync</span></span> | ||
| 164 | + | ||
| 165 | + ```js | ||
| 166 | + repository.checkoutBranch(branch, opts); | ||
| 167 | + ``` | ||
| 168 | + | ||
| 169 | + This will set the HEAD to point to the local branch and then attempt | ||
| 170 | + to update the index and working tree to match the content of the | ||
| 171 | + latest commit on that branch | ||
| 172 | + | ||
| 173 | + | Parameters | Type | | ||
| 174 | + | --- | --- | --- | | ||
| 175 | + | branch | String, [Reference](/api/reference/) | the branch to checkout | | ||
| 176 | + | opts | [Object](/api/object/), [CheckoutOptions](/api/checkout_options/) | the options to use for the checkout | | ||
| 177 | + | ||
| 162 | 178 | ## <a name="config"></a><span>Repository#</span>config <span class="tags"><span class="async">Async</span></span> | |
| 163 | 179 | ||
| 164 | 180 | ```js | |
@@ -651,10 +667,12 @@ repository.refdb().then(function(refdb) { | |||
| 651 | 667 | | --- | --- | | |
| 652 | 668 | | [Refdb](/api/refdb/) | | | |
| 653 | 669 | ||
| 654 | - ## <a name="setHead"></a><span>Repository#</span>setHead <span class="tags"><span class="sync">Sync</span></span> | ||
| 670 | + ## <a name="setHead"></a><span>Repository#</span>setHead <span class="tags"><span class="async">Async</span></span> | ||
| 655 | 671 | ||
| 656 | 672 | ```js | |
| 657 | - var result = repository.setHead(refname, signature, log_message); | ||
| 673 | + repository.setHead(refname, signature, log_message).then(function(result) { | ||
| 674 | + // Use result | ||
| 675 | + }); | ||
| 658 | 676 | ``` | |
| 659 | 677 | ||
| 660 | 678 | | Parameters | Type | | |
| Back | FazBrowse Home | New Git URL |
0 commit comments