Git:
Filter:
Classes | Frontends

Git : Object

git interface
Source: Git.sc

Description

An interface to the git toolchain. For more information on git, see http://git.io.

Class Methods

Git.new(localPath)

creates a new instance of Git, pointing to an existing local git repository.

Arguments:

localPath

path to the git repository.

Git.isGit(localPath)

returns true, if a local directory is a git repository.

Arguments:

localPath

Git.checkForGit

returns true, if the git toolchain is found on the system.

Inherited class methods

Instance Methods

info

.branch

Returns:

current branch name.

.remote

.url

.url = value

Returns:

url of the first remote that it finds.

.remoteAsHttpUrl

Detects if the remote URI starts with "git@" or "git:" and remodels it to a valid "https" URI. Otherwise, it returns the unaltered remote.

Returns:

remote URI formatted for http respectively https requests.

.remoteLatest

Returns:

hash of latest commit on the remote

.localPath

.localPath = value

Returns:

path to local repository

.tag

Returns:

currently checked out tag

.tags

Returns:

avaliable tags

.sha

Returns:

hash of the currently checked out version

.shaForTag(tag)

Arguments:

tag

one of the tags returned by -tags

Returns:

hash of the given tag

.isDirty

Returns:

true if there are local changes

perform actions on remote

.fetch

perform a fetch from remote

.checkout(refspec)

perform a checkout from remote with argument refspec

Arguments:

refspec

.pull

perform a pull from remote

.clone(url)

perform a clone from url into -localPath

Arguments:

url

the url of the remotes

Inherited instance methods

Examples