wilton/git
Work with Git repositories
More...
Functions | |
Undefined | clone (String url, String repo, Object|Undefined options, Function|Undefined callback) |
Clone remote Git repository. | |
Undefined | pull (String repo, Object|Undefined options, Function|Undefined callback) |
Pulls a branch from a remote Git repository. | |
String | revparseHead (String repo, Function|Undefined callback) |
Read the revision ID of the repo HEAD. |
This module allows to work with remote and local Git repositories.
Usage example:
Undefined git::clone | ( | String | url, |
String | repo, | ||
Object|Undefined | options, | ||
Function|Undefined | callback | ||
) |
Clones repote Git repository to the specified path, supports Local
, SSH
and HTTPS(S)
transport protocols.
For SSH authentication username must be specified as a part of the URL, example: git+ssh://myuser@127.0.0.1/path/to/my/app
Username may be specified either in URL or as a username
option; if both variants are used at the same time - URL takes preference.
url | String URL of the remote Git repository, must have one of the supported protocol prfixes: file:// , git+ssh:// , http:// , https:// |
repo | String path to the destination local repository |
options | Object|Undefined configuration object, can be omitted, see possible options below |
callback | Function|Undefined callback to receive result or error |
Undefined
Options
String|Undefined
Git branch to checkout after the clone, default value: master
String|Undefined
user name that should be used for Git authentication over SSH or HTTPSString|Undefined
password that should be used for Git authentication over SSH or HTTPSString|Undefined
path to the public SSH key file that should be used for authentication with the SSH serverString|Undefined
path to the private SSH key file that should be used for authentication with the SSH serverBoolean|Undefined
whether HTTPS certificate of the Git server should be checked for validness, default value: true
Undefined git::pull | ( | String | repo, |
Object|Undefined | options, | ||
Function|Undefined | callback | ||
) |
Fetches changes from the origin
remote repository and checkouts the specified remote branch.
Uses origin
remote record from the specified git repo.
See clone()
for the details about the protocols and authentication.
repo | String path to the local repository |
options | Object|Undefined configuration object, can be omitted, see possible options below |
callback | Function|Undefined callback to receive result or error |
Undefined
Options
String|Undefined
Git branch to checkout after the fetch, default value: master
String|Undefined
user name that should be used for Git authentication over SSH or HTTPSString|Undefined
password that should be used for Git authentication over SSH or HTTPSString|Undefined
path to the public SSH key file that should be used for authentication with the SSH serverString|Undefined
path to the private SSH key file that should be used for authentication with the SSH serverBoolean|Undefined
whether HTTPS certificate of the Git server should be checked for validness, default value: true
String git::revparseHead | ( | String | repo, |
Function|Undefined | callback | ||
) |
Reads the revision ID of the repo HEAD
repo | String path to the local repository |
callback | Function|Undefined callback to receive result or error |
String
40 symbols revision ID SHA1