public class PullCommand extends TransportCommand<PullCommand,PullResult>
credentialsProvider, timeout, transportConfigCallback
repo
Modifier | Constructor and Description |
---|---|
protected |
PullCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
PullResult |
call()
Executes the
Pull command with all the options and parameters
collected by the setter methods (e.g. |
static BranchConfig.BranchRebaseMode |
getRebaseMode(String branchName,
Config config)
Reads the rebase mode to use for a pull command from the repository
configuration.
|
String |
getRemote() |
String |
getRemoteBranchName() |
PullCommand |
setProgressMonitor(ProgressMonitor monitor) |
PullCommand |
setRebase(boolean useRebase)
Set if rebase should be used after fetching.
|
PullCommand |
setRebase(BranchConfig.BranchRebaseMode rebaseMode)
Sets the
BranchConfig.BranchRebaseMode to use after fetching. |
PullCommand |
setRecurseSubmodules(SubmoduleConfig.FetchRecurseSubmodulesMode recurse)
Set the mode to be used for recursing into submodules.
|
PullCommand |
setRemote(String remote)
The remote (uri or name) to be used for the pull operation.
|
PullCommand |
setRemoteBranchName(String remoteBranchName)
The remote branch name to be used for the pull operation.
|
PullCommand |
setStrategy(MergeStrategy strategy) |
PullCommand |
setTagOpt(TagOpt tagOpt)
Sets the specification of annotated tag behavior during fetch
|
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallback
checkCallable, getRepository, setCallable
protected PullCommand(Repository repo)
repo
- public PullCommand setProgressMonitor(ProgressMonitor monitor)
monitor
- a progress monitorpublic PullCommand setRebase(boolean useRebase)
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.
useRebase
- this
public PullCommand setRebase(BranchConfig.BranchRebaseMode rebaseMode)
BranchConfig.BranchRebaseMode
to use after fetching.
--rebase
on the command line: use rebase
instead of merge after fetching.--preserve-merges
on the command line: rebase
preserving local merge commits.--interactive
on the command line: use
interactive rebase.--no-rebase
: merge instead of rebasing.
null
branch.[name].rebase
or, if not set, pull.rebase
A branch can be configured to use rebase by default. See
branch.[name].rebase
, branch.autosetuprebase
, and
pull.rebase
.
rebaseMode
- the BranchConfig.BranchRebaseMode
to usethis
public PullResult call() throws GitAPIException, WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException, RefNotFoundException, RefNotAdvertisedException, NoHeadException, TransportException
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.call
in interface Callable<PullResult>
call
in class GitCommand<PullResult>
WrongRepositoryStateException
InvalidConfigurationException
DetachedHeadException
InvalidRemoteException
CanceledException
RefNotFoundException
RefNotAdvertisedException
NoHeadException
TransportException
GitAPIException
public PullCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME
will be used.remote
- this
Constants.DEFAULT_REMOTE_NAME
public PullCommand setRemoteBranchName(String remoteBranchName)
remoteBranchName
- this
public String getRemote()
public String getRemoteBranchName()
public PullCommand setStrategy(MergeStrategy strategy)
strategy
- The merge strategy to use during this pull operation.this
public PullCommand setTagOpt(TagOpt tagOpt)
tagOpt
- this
public PullCommand setRecurseSubmodules(SubmoduleConfig.FetchRecurseSubmodulesMode recurse)
recurse
- this
public static BranchConfig.BranchRebaseMode getRebaseMode(String branchName, Config config)
branch.[branchName].rebase
, or,if not set, pull.rebase
.
If neither is set, yields BranchConfig.BranchRebaseMode.NONE
.branchName
- name of the local branchconfig
- the Config
to read the value fromBranchConfig.BranchRebaseMode
Copyright © 2017 Eclipse JGit Project. All rights reserved.