public interface AQGit
Modifier and Type | Method and Description |
---|---|
void |
add(Object files)
Adds file or files to the list of files staged for the next commit.
|
void |
add(String filePattern,
boolean update)
Adds file or files to the list of files staged for the next commit.
|
void |
addRemote(String name,
String url)
Add a remote.
|
void |
applyStash(String ref)
Apply a stashed commit on top of the current working tree.
|
void |
checkout(String name)
Checkout a branch
|
void |
cherryPick(Object revision)
Integrates an individual commit into the current branch.
|
String[] |
clean(Object files,
boolean dryRun)
Remove untracked files from the working tree.
|
void |
clone(String folder,
String url,
String branch)
Clones a repository into a new directory.
|
void |
commit(Object files,
Object username,
Object email,
String comment)
This method commits changes in the specified file or folder.
|
void |
commit(Object username,
Object email,
String comment)
This method records changes to the repository.
|
void |
createBranch(String name,
String ref)
Create a local branch.
|
void |
createStash(Object username,
Object email,
String indexMessage,
String workingMessage)
Stash all current changes and return working tree to a clean state.
|
void |
deleteBranch(String... names)
Delete one or more branches.
|
void |
deleteTag(String... tags)
Delete one or more tags.
|
void |
dropStash(int stashRef)
Delete a stashed commit.
|
void |
fetch()
Downloads objects and refs from the default remote 'origin'.
|
void |
fetch(String remote)
Downloads objects and refs from the specified remote repository.
|
AQRevision[] |
getHistory(String filename)
Returns the file's complete revision history.
|
AQRevision[] |
getHistory(String filename,
int count)
Returns the file's revision history.
|
AQRevision |
getRevision(String filename)
Returns the file revision.
|
byte[] |
getRevisionContents(String filename,
Object revision)
Returns the binary contents of the specified revision.
|
void |
init(String folder,
boolean bare)
Creates an empty git repository or reinitialize an existing one.
|
String[] |
listBranch()
Obtain a list of branches
|
String[] |
listRemote()
List remotes.
|
AQRevision[] |
listStash()
Return a list of stash commits
|
String[] |
listTag()
Obtain a list of tags.
|
AQRevision[] |
log(Object start,
int count)
Obtain the log.
|
void |
merge(Object revision)
Performs a very basic merge operation, which allows only one argument.
|
void |
pull()
Incorporates changes from a remote repository into the current branch.
|
void |
push()
Push new branches and data to a remote repository.
|
void |
rebase(Object upstream)
The Git rebase command.
|
void |
rebaseAbort()
Abort the rebase process.
|
void |
rebaseContinue()
Continue the rebase process.
|
void |
rebaseSkip()
Skip the rebase process.
|
void |
removeRemote(String name)
Remove a remote.
|
void |
renameBranch(String oldName,
String newName)
Rename a branch
|
void |
reset(String ref,
String mode,
String filename)
Undo changes and commits.
|
void |
revert(Object commits)
Create a commit with the reverse patch to cancel it out.
|
void |
setCredentials(String url,
String identity,
String password)
Register a credentials provider.
|
void |
setVerbose(boolean verbose)
Sets the amount of diagnostic messages sent to the debugger console.
|
void |
setWorkspace(String path)
Sets workspace folder.
|
AQGitStatus |
status()
Obtain the Git repo status.
|
void |
tag(Object revision,
String name,
Object username,
Object email,
String comment)
Create a tag.
|
void |
trackRemote(String localBranch,
String remoteBranch)
Track remote branch.
|
void setVerbose(boolean verbose)
verbose
- (Default value - true).void setWorkspace(String path)
path
- Workspace path.void setCredentials(String url, String identity, String password) throws Exception
For public key authentication, Setting identity to null
loads known hosts
and private keys from $HOME/.ssh
.
url
- the url, protocol://host/path/to/repo.gitidentity
- username or public key filepassword
- password or passphraseException
- On errorvoid commit(Object files, Object username, Object email, String comment) throws Exception
files
- A file name, or a javascript array of file namesusername
- A String
or a AQOpaqueObject
containing the user name.email
- A String
or a AQOpaqueObject
containing the user email address.comment
- the commentException
- On errorvoid commit(Object username, Object email, String comment) throws Exception
username
- A String
or a AQOpaqueObject
containing the user name.email
- A String
or a AQOpaqueObject
containing the user email address.comment
- the commentException
- On errorvoid add(Object files) throws Exception
files
- A file name, or a javascript array of file namesException
- On errorvoid add(String filePattern, boolean update) throws Exception
filePattern
- File to add content from. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files
in the directory, recursively. Fileglobs (e.g. *.c) are not yet supported.update
- If set to true, the command only matches filepattern against already tracked files in the index rather than the working tree. That
means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove
files from the index if the corresponding files in the working tree have been removed. In contrast to the git command line a
filepattern must exist also if update is set to true as there is no concept of a working directory here.Exception
- On errorAQRevision getRevision(String filename) throws Exception
filename
- Workspace file nameException
- On errorAQRevision[] getHistory(String filename) throws Exception
filename
- Workspace file nameException
- On errorAQRevision[] getHistory(String filename, int count) throws Exception
filename
- Workspace file namecount
- Maximum number of revisions to returnException
- On errorbyte[] getRevisionContents(String filename, Object revision) throws Exception
filename
- Workspace file namerevision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
Exception
- On errorvoid merge(Object revision) throws Exception
revision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
which is merged with the current headException
- On errorvoid clone(String folder, String url, String branch) throws Exception
folder
- Destination folderurl
- Repository URL, protocol://host/path/to/repo.gitbranch
- (Optional) branch name. An empty branch name (or null
) selects the repository HEADException
- On errorvoid fetch() throws Exception
Exception
- On errorvoid fetch(String remote) throws Exception
remote
- the remote to fetch fromException
- On errorvoid pull() throws Exception
Exception
- On errorvoid init(String folder, boolean bare) throws Exception
folder
- the folderbare
- When true, creates a bare repository.Exception
- On errorvoid push() throws Exception
Exception
- On errorvoid reset(String ref, String mode, String filename) throws Exception
ref
- A reference to a commit. Points to HEAD if null
mode
- The mode. One of "SOFT", "MIXED" or "HARD"filename
- Workspace file name. May be null
to indicate all files
Note: the mode and filename parameters cannot be combined.
Exception
- On errorString[] listBranch() throws Exception
Exception
- On errorvoid createBranch(String name, String ref) throws Exception
name
- the name of the new branchref
- corresponds to the start-point; if null
, HEAD will be usedException
- On errorvoid checkout(String name) throws Exception
name
- the branch nameException
- On errorvoid renameBranch(String oldName, String newName) throws Exception
oldName
- the name of the branch to rename; if not set, the currently
checked out branch (if any) will be renamednewName
- the new nameException
- On errorvoid deleteBranch(String... names) throws Exception
names
- the names of the branches to delete; if not set, this will do
nothing; invalid branch names will simply be ignoredException
- On errorString[] listTag() throws Exception
Exception
- On errorvoid tag(Object revision, String name, Object username, Object email, String comment) throws Exception
revision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
name
- the tag nameusername
- A String
or a AQOpaqueObject
containing the user name.email
- A String
or a AQOpaqueObject
containing the user email address.comment
- the tag messageException
- On errorvoid deleteTag(String... tags) throws Exception
tags
- tags to be deletedException
- On errorvoid rebase(Object upstream) throws Exception
upstream
- A branch name, an AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
If the operation fails (i.e. due to a merge conflict), a RuntimeException will be thrown.
Exception
- On errorvoid rebaseContinue() throws Exception
Exception
- On errorvoid rebaseAbort() throws Exception
Exception
- On errorString[] listRemote() throws Exception
Exception
- On errorvoid addRemote(String name, String url) throws Exception
name
- the remote nameurl
- the remote url, protocol://host/path/to/repo.gitException
- On errorvoid removeRemote(String name) throws Exception
name
- the remote nameException
- On errorvoid trackRemote(String localBranch, String remoteBranch) throws Exception
localBranch
- the local branchremoteBranch
- the remote branch. Use null
to remove remote branch tracking
from local branchException
- On errorvoid cherryPick(Object revision) throws Exception
revision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
If the operation fails (i.e. due to a merge conflict), a RuntimeException will be thrown.
Exception
- On errorAQRevision[] listStash() throws Exception
Exception
- On errorvoid createStash(Object username, Object email, String indexMessage, String workingMessage) throws Exception
username
- A String
or a AQOpaqueObject
containing the user name.email
- A String
or a AQOpaqueObject
containing the user email address.indexMessage
- the message used when committing index changesworkingMessage
- the message used when committing working directory changesException
- On errorvoid applyStash(String ref) throws Exception
ref
- the reference (stash@{x}) to update with the stashed commit id. Use null
for all stashesException
- On errorvoid dropStash(int stashRef) throws Exception
stashRef
- Set the stash reference to drop (0-based)Exception
- On errorAQRevision[] log(Object start, int count) throws Exception
start
- a commit to start graph traversal from. Use null
for HEADcount
- the number of commits to obtain. Use -1 for allException
- On errorAQGitStatus status() throws Exception
Exception
- On errorvoid revert(Object commits) throws Exception
commits
- an AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
, or a list of such objects.Exception
- On errorString[] clean(Object files, boolean dryRun) throws Exception
files
- a file name, or a javascript array of file names, or null
for all untracked filesdryRun
- if it is set, the files in question will not actually be deletedException
- On error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.