An interface to the git toolchain. For more information on git, see http://git.io.
creates a new instance of Git
, pointing to an existing local git repository.
localPath |
path to the git repository. |
returns true
, if a local directory is a git repository.
localPath |
returns true
, if the git toolchain is found on the system.
current branch name.
url of the first remote that it finds.
Detects if the remote URI starts with "git@"
or "git:"
and remodels it to a valid "https"
URI. Otherwise, it returns the unaltered remote.
// git-style remote URI's are transformed to https
Git().url_("git@github.com:foo/bar.git").remoteAsHttpUrl;
Git().url_("https://github.com/foo/bar").remoteAsHttpUrl;
Git().url_("git@foo.net:foo/bar.git").remoteAsHttpUrl;
// http and https are left untouched
Git().url_("https://foo.org/bar").remoteAsHttpUrl;
Git().url_("http://foo.org/bar").remoteAsHttpUrl;
// unknown URI styles are left untouched
Git().url_("fooBar").remoteAsHttpUrl;
remote URI formatted for http
respectively https
requests.
hash of latest commit on the remote
path to local repository
currently checked out tag
avaliable tags
hash of the currently checked out version
true
if there are local changes
perform a fetch from remote
perform a checkout from remote with argument refspec
refspec |
perform a pull from remote
xxxxxxxxxx
// create a Git that points to a Quark directory
g = Git(Quarks.all.choose.localPath);
// alternatively, provide a pathname to a local git repository:
g = Git("/path/to/local/repo");
// get all available tags
g.tags;
// return local path
g.localPath;
// return url
g.url;