Class PullCommand

    • Constructor Detail

      • PullCommand

        protected PullCommand​(Repository repo)
        Constructor for PullCommand.
        Parameters:
        repo - the Repository
    • Method Detail

      • setProgressMonitor

        public PullCommand setProgressMonitor​(ProgressMonitor monitor)
        Set progress 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 - whether to use rebase after fetching
        Returns:
        this
      • setRebase

        public PullCommand setRebase​(BranchConfig.BranchRebaseMode rebaseMode)
        Sets the BranchConfig.BranchRebaseMode to use after fetching.
        BranchRebaseMode.REBASE
        Equivalent to --rebase on the command line: use rebase instead of merge after fetching.
        BranchRebaseMode.PRESERVE
        Equivalent to --preserve-merges on the command line: rebase preserving local merge commits.
        BranchRebaseMode.INTERACTIVE
        Equivalent to --interactive on the command line: use interactive rebase.
        BranchRebaseMode.NONE
        Equivalent to --no-rebase: merge instead of rebasing.
        null
        Use the setting defined in the git configuration, either branch.[name].rebase or, if not set, pull.rebase
        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, branch.autosetuprebase, and pull.rebase.

        Parameters:
        rebaseMode - the BranchConfig.BranchRebaseMode to use
        Returns:
        this
        Since:
        4.5
      • setRemote

        public PullCommand setRemote​(String remote)
        The remote (uri or name) to be used for the pull operation. If no remote is set, the branch's configuration will be used. If the branch configuration is missing the default value of Constants.DEFAULT_REMOTE_NAME will be used.
        Parameters:
        remote - name of the remote to pull from
        Returns:
        this
        Since:
        3.3
        See Also:
        Constants.DEFAULT_REMOTE_NAME
      • setRemoteBranchName

        public PullCommand setRemoteBranchName​(String remoteBranchName)
        The remote branch name to be used for the pull operation. If no remoteBranchName is set, the branch's configuration will be used. If the branch configuration is missing the remote branch with the same name as the current branch is used.
        Parameters:
        remoteBranchName - remote branch name to be used for pull operation
        Returns:
        this
        Since:
        3.3
      • getRemote

        public String getRemote()
        Get the remote name used for pull operation
        Returns:
        the remote used for the pull operation if it was set explicitly
        Since:
        3.3
      • getRemoteBranchName

        public String getRemoteBranchName()
        Get the remote branch name for the pull operation
        Returns:
        the remote branch name used for the pull operation if it was set explicitly
        Since:
        3.3
      • setStrategy

        public PullCommand setStrategy​(MergeStrategy strategy)
        Set the @{code MergeStrategy}
        Parameters:
        strategy - The merge strategy to use during this pull operation.
        Returns:
        this
        Since:
        3.4
      • setTagOpt

        public PullCommand setTagOpt​(TagOpt tagOpt)
        Set the specification of annotated tag behavior during fetch
        Parameters:
        tagOpt - the TagOpt
        Returns:
        this
        Since:
        4.7
      • setFastForward

        public PullCommand setFastForward​(@Nullable
                                          MergeCommand.FastForwardMode fastForwardMode)
        Set the fast forward mode. It is used if pull is configured to do a merge as opposed to rebase. If non-null takes precedence over the fast-forward mode configured in git config.
        Parameters:
        fastForwardMode - corresponds to the --ff/--no-ff/--ff-only options. If null use the value of pull.ff configured in git config. If pull.ff is not configured fall back to the value of merge.ff. If merge.ff is not configured --ff is the built-in default.
        Returns:
        this
        Since:
        4.9