public interface AQGit
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object files)
Adds file or files to the list of files staged for the next commit.
|
void |
add(java.lang.String filePattern,
boolean update)
Adds file or files to the list of files staged for the next commit.
|
void |
addRemote(java.lang.String name,
java.lang.String url)
Add a remote.
|
void |
applyStash(java.lang.String ref)
Apply a stashed commit on top of the current working tree.
|
void |
checkout(java.lang.String name)
Checkout a branch
|
void |
cherryPick(java.lang.Object revision)
Integrates an individual commit into the current branch.
|
java.lang.String[] |
clean(java.lang.Object files,
boolean dryRun)
Remove untracked files from the working tree.
|
void |
clone(java.lang.String folder,
java.lang.String url,
java.lang.String branch)
Clones a repository into a new directory.
|
void |
commit(java.lang.Object files,
java.lang.Object username,
java.lang.Object email,
java.lang.String comment)
This method commits changes in the specified file or folder.
|
void |
commit(java.lang.Object username,
java.lang.Object email,
java.lang.String comment)
This method records changes to the repository.
|
void |
createBranch(java.lang.String name,
java.lang.String ref)
Create a local branch.
|
void |
createStash(java.lang.Object username,
java.lang.Object email,
java.lang.String indexMessage,
java.lang.String workingMessage)
Stash all current changes and return working tree to a clean state.
|
void |
deleteBranch(java.lang.String... names)
Delete one or more branches.
|
void |
deleteTag(java.lang.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(java.lang.String remote)
Downloads objects and refs from the specified remote repository.
|
AQRevision[] |
getHistory(java.lang.String filename)
Returns the file's complete revision history.
|
AQRevision[] |
getHistory(java.lang.String filename,
int count)
Returns the file's revision history.
|
AQRevision |
getRevision(java.lang.String filename)
Returns the file revision.
|
byte[] |
getRevisionContents(java.lang.String filename,
java.lang.Object revision)
Returns the binary contents of the specified revision.
|
void |
init(java.lang.String folder,
boolean bare)
Creates an empty git repository or reinitialize an existing one.
|
java.lang.String[] |
listBranch()
Obtain a list of branches
|
java.lang.String[] |
listRemote()
List remotes.
|
AQRevision[] |
listStash()
Return a list of stash commits
|
java.lang.String[] |
listTag()
Obtain a list of tags.
|
AQRevision[] |
log(java.lang.Object start,
int count)
Obtain the log.
|
void |
merge(java.lang.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(java.lang.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(java.lang.String name)
Remove a remote.
|
void |
renameBranch(java.lang.String oldName,
java.lang.String newName)
Rename a branch
|
void |
reset(java.lang.String ref,
java.lang.String mode,
java.lang.String filename)
Undo changes and commits.
|
void |
revert(java.lang.Object commits)
Create a commit with the reverse patch to cancel it out.
|
void |
setCredentials(java.lang.String url,
java.lang.String identity,
java.lang.String password)
Register a credentials provider.
|
void |
setVerbose(boolean verbose)
Sets the amount of diagnostic messages sent to the debugger console.
|
void |
setWorkspace(java.lang.String path)
Sets workspace folder.
|
AQGitStatus |
status()
Obtain the Git repo status.
|
void |
tag(java.lang.Object revision,
java.lang.String name,
java.lang.Object username,
java.lang.Object email,
java.lang.String comment)
Create a tag.
|
void |
trackRemote(java.lang.String localBranch,
java.lang.String remoteBranch)
Track remote branch.
|
void setVerbose(boolean verbose)
verbose
- (Default value - true).void setWorkspace(java.lang.String path)
path
- Workspace path.void setCredentials(java.lang.String url, java.lang.String identity, java.lang.String password) throws java.lang.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 passphrasejava.lang.Exception
- On errorvoid commit(java.lang.Object files, java.lang.Object username, java.lang.Object email, java.lang.String comment) throws java.lang.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 commentjava.lang.Exception
- On errorvoid commit(java.lang.Object username, java.lang.Object email, java.lang.String comment) throws java.lang.Exception
username
- A String
or a AQOpaqueObject
containing the user name.email
- A String
or a AQOpaqueObject
containing the user email address.comment
- the commentjava.lang.Exception
- On errorvoid add(java.lang.Object files) throws java.lang.Exception
files
- A file name, or a javascript array of file namesjava.lang.Exception
- On errorvoid add(java.lang.String filePattern, boolean update) throws java.lang.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.java.lang.Exception
- On errorAQRevision getRevision(java.lang.String filename) throws java.lang.Exception
filename
- Workspace file namejava.lang.Exception
- On errorAQRevision[] getHistory(java.lang.String filename) throws java.lang.Exception
filename
- Workspace file namejava.lang.Exception
- On errorAQRevision[] getHistory(java.lang.String filename, int count) throws java.lang.Exception
filename
- Workspace file namecount
- Maximum number of revisions to returnjava.lang.Exception
- On errorbyte[] getRevisionContents(java.lang.String filename, java.lang.Object revision) throws java.lang.Exception
filename
- Workspace file namerevision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
java.lang.Exception
- On errorvoid merge(java.lang.Object revision) throws java.lang.Exception
revision
- An AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
which is merged with the current headjava.lang.Exception
- On errorvoid clone(java.lang.String folder, java.lang.String url, java.lang.String branch) throws java.lang.Exception
folder
- Destination folderurl
- Repository URL, protocol://host/path/to/repo.gitbranch
- (Optional) branch name. An empty branch name (or null
) selects the repository HEADjava.lang.Exception
- On errorvoid fetch() throws java.lang.Exception
java.lang.Exception
- On errorvoid fetch(java.lang.String remote) throws java.lang.Exception
remote
- the remote to fetch fromjava.lang.Exception
- On errorvoid pull() throws java.lang.Exception
java.lang.Exception
- On errorvoid init(java.lang.String folder, boolean bare) throws java.lang.Exception
folder
- the folderbare
- When true, creates a bare repository.java.lang.Exception
- On errorvoid push() throws java.lang.Exception
java.lang.Exception
- On errorvoid reset(java.lang.String ref, java.lang.String mode, java.lang.String filename) throws java.lang.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.
java.lang.Exception
- On errorjava.lang.String[] listBranch() throws java.lang.Exception
java.lang.Exception
- On errorvoid createBranch(java.lang.String name, java.lang.String ref) throws java.lang.Exception
name
- the name of the new branchref
- corresponds to the start-point; if null
, HEAD will be usedjava.lang.Exception
- On errorvoid checkout(java.lang.String name) throws java.lang.Exception
name
- the branch namejava.lang.Exception
- On errorvoid renameBranch(java.lang.String oldName, java.lang.String newName) throws java.lang.Exception
oldName
- the name of the branch to rename; if not set, the currently
checked out branch (if any) will be renamednewName
- the new namejava.lang.Exception
- On errorvoid deleteBranch(java.lang.String... names) throws java.lang.Exception
names
- the names of the branches to delete; if not set, this will do
nothing; invalid branch names will simply be ignoredjava.lang.Exception
- On errorjava.lang.String[] listTag() throws java.lang.Exception
java.lang.Exception
- On errorvoid tag(java.lang.Object revision, java.lang.String name, java.lang.Object username, java.lang.Object email, java.lang.String comment) throws java.lang.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 messagejava.lang.Exception
- On errorvoid deleteTag(java.lang.String... tags) throws java.lang.Exception
tags
- tags to be deletedjava.lang.Exception
- On errorvoid rebase(java.lang.Object upstream) throws java.lang.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.
java.lang.Exception
- On errorvoid rebaseContinue() throws java.lang.Exception
java.lang.Exception
- On errorvoid rebaseSkip() throws java.lang.Exception
java.lang.Exception
- On errorvoid rebaseAbort() throws java.lang.Exception
java.lang.Exception
- On errorjava.lang.String[] listRemote() throws java.lang.Exception
java.lang.Exception
- On errorvoid addRemote(java.lang.String name, java.lang.String url) throws java.lang.Exception
name
- the remote nameurl
- the remote url, protocol://host/path/to/repo.gitjava.lang.Exception
- On errorvoid removeRemote(java.lang.String name) throws java.lang.Exception
name
- the remote namejava.lang.Exception
- On errorvoid trackRemote(java.lang.String localBranch, java.lang.String remoteBranch) throws java.lang.Exception
localBranch
- the local branchremoteBranch
- the remote branch. Use null
to remove remote branch tracking
from local branchjava.lang.Exception
- On errorvoid cherryPick(java.lang.Object revision) throws java.lang.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.
java.lang.Exception
- On errorAQRevision[] listStash() throws java.lang.Exception
java.lang.Exception
- On errorvoid createStash(java.lang.Object username, java.lang.Object email, java.lang.String indexMessage, java.lang.String workingMessage) throws java.lang.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 changesjava.lang.Exception
- On errorvoid applyStash(java.lang.String ref) throws java.lang.Exception
ref
- the reference (stash@{x}) to update with the stashed commit id. Use null
for all stashesjava.lang.Exception
- On errorvoid dropStash(int stashRef) throws java.lang.Exception
stashRef
- Set the stash reference to drop (0-based)java.lang.Exception
- On errorAQRevision[] log(java.lang.Object start, int count) throws java.lang.Exception
start
- a commit to start graph traversal from. Use null
for HEADcount
- the number of commits to obtain. Use -1 for alljava.lang.Exception
- On errorAQGitStatus status() throws java.lang.Exception
java.lang.Exception
- On errorvoid revert(java.lang.Object commits) throws java.lang.Exception
commits
- an AQRevision
object or a SHA-1 hash of a commit, obtained via
AQRevision.getRevision()
, or a list of such objects.java.lang.Exception
- On errorjava.lang.String[] clean(java.lang.Object files, boolean dryRun) throws java.lang.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 deletedjava.lang.Exception
- On error
Copyright © 2019 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.