org.eclipse.jgit.api
Class PullCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<T>
org.eclipse.jgit.api.TransportCommand<PullCommand,PullResult>
org.eclipse.jgit.api.PullCommand
- All Implemented Interfaces:
- Callable<PullResult>
public class PullCommand
- extends TransportCommand<PullCommand,PullResult>
The Pull command
- See Also:
- Git documentation about Pull
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PullCommand
protected PullCommand(Repository repo)
- Parameters:
repo
-
setProgressMonitor
public PullCommand setProgressMonitor(ProgressMonitor monitor)
- Parameters:
monitor
- a progress monitor
- Returns:
- this instance
setRebase
public PullCommand setRebase(boolean useRebase)
- Set if rebase should be used after fetching. If set to true, rebase is
used instead of merge. This is equivalent to --rebase on the command line.
If set to false, merge is used after fetching, overriding the configuration
file. This is equivalent to --no-rebase on the command line.
This setting overrides the settings in the configuration file.
By default, the setting in the repository configuration file is used.
A branch can be configured to use rebase by default.
See branch.[name].rebase and branch.autosetuprebase.
- Parameters:
useRebase
-
- Returns:
this
call
public PullResult call()
throws GitAPIException,
WrongRepositoryStateException,
InvalidConfigurationException,
DetachedHeadException,
InvalidRemoteException,
CanceledException,
RefNotFoundException,
NoHeadException,
TransportException
- Executes the
Pull
command with all the options and parameters
collected by the setter methods (e.g.
setProgressMonitor(ProgressMonitor)
) of this class. Each
instance of this class should only be used for one invocation of the
command. Don't call this method twice on an instance.
- Specified by:
call
in interface Callable<PullResult>
- Specified by:
call
in class GitCommand<PullResult>
- Returns:
- the result of the pull
- Throws:
WrongRepositoryStateException
InvalidConfigurationException
DetachedHeadException
InvalidRemoteException
CanceledException
RefNotFoundException
NoHeadException
TransportException
GitAPIException
Copyright © 2013. All Rights Reserved.