public class ResetCommand extends GitCommand<Ref>
Reset
command. It has setters for all
supported options and arguments of this command and a call()
method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call()
)Modifier and Type | Class and Description |
---|---|
static class |
ResetCommand.ResetType
Kind of reset
|
repo
Constructor and Description |
---|
ResetCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
ResetCommand |
addPath(String path) |
Ref |
call()
Executes the
Reset command. |
ResetCommand |
setMode(ResetCommand.ResetType mode) |
ResetCommand |
setRef(String ref) |
checkCallable, getRepository, setCallable
public ResetCommand(Repository repo)
repo
- public Ref call() throws GitAPIException, CheckoutConflictException
Reset
command. Each instance of this class should
only be used for one invocation of the command. Don't call this method
twice on an instance.call
in interface Callable<Ref>
call
in class GitCommand<Ref>
GitAPIException
CheckoutConflictException
public ResetCommand setRef(String ref)
ref
- the ref to reset to, defaults to HEAD if not specifiedpublic ResetCommand setMode(ResetCommand.ResetType mode)
mode
- the mode of the reset commandpublic ResetCommand addPath(String path)
path
- repository-relative path of file/directory to reset (with
/
as separator)Copyright © 2016 Eclipse JGit Project. All rights reserved.